Skip to content

Commit

Permalink
chore: enhance exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
gutyerrez committed Nov 17, 2024
1 parent cadacf7 commit 035644f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export class Exception extends Error {
public readonly name: string;

constructor(status: number, name: string, parameters?: Record<string, string | number>, message?: string) {
super(i18next.t(message ?? name, parameters));
super(i18next.t(message ?? name, {
defaultValue: name,
...parameters
}));

this.status = status;
this.name = name;
Expand Down

0 comments on commit 035644f

Please sign in to comment.