diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index e61a6fe95..2db5cd7b4 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -51,6 +51,7 @@ import { OperationAttemptResultType, RetryInfo, } from "../util/retries.js"; +import { CryptoApiStoppedError } from "../crypto/workers/crypto-dispatcher.js"; const logger = new Logger("operations/common.ts"); @@ -260,6 +261,19 @@ export async function runOperationWithErrorReporting<T1, T2>( return resp; } } catch (e) { + if (e instanceof CryptoApiStoppedError) { + if (ws.stopped) { + logger.warn("crypto API stopped during shutdown, ignoring error"); + return { + type: OperationAttemptResultType.Error, + errorDetail: makeErrorDetail( + TalerErrorCode.WALLET_UNEXPECTED_EXCEPTION, + {}, + "Crypto API stopped during shutdown", + ), + }; + } + } if (e instanceof TalerError) { logger.warn("operation processed resulted in error"); logger.warn(`error was: ${j2s(e.errorDetail)}`); |