Skip to content

Commit

Permalink
fix: stringify exception as much as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
alvis committed Feb 11, 2024
1 parent 34ae52b commit 2f034a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/xception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export default function xception(
// create a new Xception with the given message and options
const { namespace, meta, tags } = { ...options };
// try to extract the message from the exception, otherwise use a generic message
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
const message = `non-error: ${exception}`;
const message = `non-error: ${String(exception)}`;

return factory(message, { namespace, meta, tags, cause });
}
Expand Down

0 comments on commit 2f034a2

Please sign in to comment.