From 2b1a86bf0ef788af83a46e2dcc9f9a524293741e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sat, 19 Dec 2020 03:06:21 +0200 Subject: [PATCH] Fix stderr formatting of ErisError --- backend/src/ErisError.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/ErisError.ts b/backend/src/ErisError.ts index 489a43f7..732fa53b 100644 --- a/backend/src/ErisError.ts +++ b/backend/src/ErisError.ts @@ -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}`; } }