From e6ed901626a5219a1d091f4f41654365d2c29531 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 19 Feb 2023 23:13:44 +0100 Subject: wallet-core: various p2p payment fixes --- packages/taler-wallet-core/src/operations/common.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'packages/taler-wallet-core/src/operations/common.ts') 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( 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)}`); -- cgit v1.2.3