diff options
author | Florian Dold <florian@dold.me> | 2024-04-22 23:42:29 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-04-22 23:42:29 +0200 |
commit | 548b979485ff5d01d99313933839f1e88523e4b3 (patch) | |
tree | eea974176aee94edaaec757c0f2887e63e2664d8 /packages/taler-util | |
parent | 00095769c8f047ddad204c14379839efbbc8640d (diff) | |
download | wallet-core-548b979485ff5d01d99313933839f1e88523e4b3.tar.xz |
wallet-core: avoid unresolved promise rejection
Diffstat (limited to 'packages/taler-util')
-rw-r--r-- | packages/taler-util/src/errors.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/taler-util/src/errors.ts b/packages/taler-util/src/errors.ts index 4dea7e1b6..9378d25e8 100644 --- a/packages/taler-util/src/errors.ts +++ b/packages/taler-util/src/errors.ts @@ -278,6 +278,10 @@ export class TalerError<T = any> extends Error { } } +export function safeStringifyException(e: any): string { + return JSON.stringify(getErrorDetailFromException(e), undefined, 2); +} + /** * Convert an exception (or anything that was thrown) into * a TalerErrorDetail object. |