3
0
Fork 0
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:
Dragory 2020-12-18 05:24:07 +02:00
parent 301ba5627d
commit d8a653202c
2 changed files with 78 additions and 49 deletions

14
backend/src/ErisError.ts Normal file
View 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}`;
}
}