Skip to content

Commit

Permalink
chore: adjust sender error
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 11, 2020
1 parent 5443b83 commit 522605a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/koishi-core/src/sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ import {
} from './meta'

export class SenderError extends Error {
readonly name = 'SenderError'

constructor (readonly args: Record<string, any>, readonly url: string, readonly retcode: number) {
constructor (args: Record<string, any>, url: string, retcode: number) {
super(`Error when trying to send to ${url}, args: ${JSON.stringify(args)}, retcode: ${retcode}`)
Object.defineProperties(this, {
name: { value: 'SenderError' },
code: { value: retcode },
args: { value: args },
url: { value: url },
})
}
}

Expand Down

0 comments on commit 522605a

Please sign in to comment.