From 035644f3031567efc0a7370605941e3e04269769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Gutierrez?= Date: Sun, 17 Nov 2024 17:23:29 -0300 Subject: [PATCH] chore: enhance exception message --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6b36029..e4e32e1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,10 @@ export class Exception extends Error { public readonly name: string; constructor(status: number, name: string, parameters?: Record, message?: string) { - super(i18next.t(message ?? name, parameters)); + super(i18next.t(message ?? name, { + defaultValue: name, + ...parameters + })); this.status = status; this.name = name;