Skip to content

Commit

Permalink
refactor: 优化 Dingtalk/ServerChanV3 的错误提示
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Nov 9, 2024
1 parent d75bf15 commit 865957e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/push/dingtalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export class Dingtalk implements Send {
this.SECRET = DINGTALK_SECRET
Debugger('DINGTALK_ACCESS_TOKEN: %s , DINGTALK_SECRET: %s', this.ACCESS_TOKEN, this.SECRET)
if (!this.ACCESS_TOKEN) {
throw new Error('ACCESS_TOKEN 是必须的!')
throw new Error('DINGTALK_ACCESS_TOKEN 是必须的!')
}
if (!this.SECRET) {
warn('未提供 SECRET !')
warn('未提供 DINGTALK_SECRET !')
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/push/server-chan-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ export class ServerChanV3 implements Send {
this.sendkey = sendkey
Debugger('set sendkey: "%s"', sendkey)
if (!this.sendkey) {
throw new Error('sendkey 是必须的!')
throw new Error('SERVER_CHAN_V3_SENDKEY 是必须的!')
}
this.uid = this.sendkey.match(/^sctp(\d+)t/)?.[1]
if (!this.uid) {
throw new Error('sendkey 不合法!')
throw new Error('SERVER_CHAN_V3_SENDKEY 不合法!')
}
}

Expand Down

0 comments on commit 865957e

Please sign in to comment.