diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:09:54 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:09:54 -0300 |
commit | 8a70edb2f8e235c3462127b0aa4e1b65aa1aee0b (patch) | |
tree | cef85adaff404ecf3ad9ed823c216776bb2871e4 /packages/taler-wallet-core/src/errors.ts | |
parent | efb5bf9de465be29de06c30c9e8cd78374b7c118 (diff) |
add 'when' to error-detail and remove error as normal response when doing backup
Diffstat (limited to 'packages/taler-wallet-core/src/errors.ts')
-rw-r--r-- | packages/taler-wallet-core/src/errors.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/errors.ts b/packages/taler-wallet-core/src/errors.ts index 37a31a8aa..308e9c7a8 100644 --- a/packages/taler-wallet-core/src/errors.ts +++ b/packages/taler-wallet-core/src/errors.ts @@ -103,7 +103,8 @@ export function makeErrorDetail<C extends TalerErrorCode>( if (!hint && !(detail as any).hint) { hint = getDefaultHint(code); } - return { code, hint, ...detail }; + const when = new Date().toISOString(); + return { code, when, hint, ...detail }; } export function makePendingOperationFailedError( @@ -160,7 +161,8 @@ export class TalerError<T = any> extends Error { if (!hint) { hint = getDefaultHint(code); } - return new TalerError<unknown>({ code, hint, ...detail }); + const when = new Date().toISOString(); + return new TalerError<unknown>({ code, when, hint, ...detail }); } static fromUncheckedDetail(d: TalerErrorDetail): TalerError { |