zappyzep/backend/src/ErisError.ts

17 lines
410 B
TypeScript
Raw Normal View History

2020-12-19 03:06:21 +02:00
import util from "util";
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;
}
2020-12-19 03:06:21 +02:00
[util.inspect.custom]() {
return `[ERIS] [ERROR CODE ${this.code || "?"}] [SHARD ${this.shardId}] ${this.message}`;
}
}