mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-21 16:55:03 +00:00
Handle eris errors in common error handler
This commit is contained in:
parent
301ba5627d
commit
d8a653202c
2 changed files with 78 additions and 49 deletions
14
backend/src/ErisError.ts
Normal file
14
backend/src/ErisError.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
export class ErisError extends Error {
|
||||
code: number | string | undefined;
|
||||
shardId: number;
|
||||
|
||||
constructor(message: string, code: number | string | undefined, shardId: number) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.shardId = shardId;
|
||||
}
|
||||
|
||||
toString() {
|
||||
return `[ERIS] [CODE ${this.code || "?"}] [SHARD ${this.shardId}] ${this.message}`;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue