3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix stderr formatting of ErisError

This commit is contained in:
Dragory 2020-12-19 03:06:21 +02:00
parent a60cb92b74
commit 2b1a86bf0e
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1,3 +1,5 @@
import util from "util";
export class ErisError extends Error {
code: number | string | undefined;
shardId: number;
@ -8,7 +10,7 @@ export class ErisError extends Error {
this.shardId = shardId;
}
toString() {
return `[ERIS] [CODE ${this.code || "?"}] [SHARD ${this.shardId}] ${this.message}`;
[util.inspect.custom]() {
return `[ERIS] [ERROR CODE ${this.code || "?"}] [SHARD ${this.shardId}] ${this.message}`;
}
}