summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/common.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-19 23:13:44 +0100
committerFlorian Dold <florian@dold.me>2023-02-19 23:13:44 +0100
commite6ed901626a5219a1d091f4f41654365d2c29531 (patch)
tree1dfb2fbc7615ebe6e91621b901bf90968bd98edf /packages/taler-wallet-core/src/operations/common.ts
parent925ef1f410e01323ee24ab9019afcc1713bf07c2 (diff)
downloadwallet-core-e6ed901626a5219a1d091f4f41654365d2c29531.tar.gz
wallet-core-e6ed901626a5219a1d091f4f41654365d2c29531.tar.bz2
wallet-core-e6ed901626a5219a1d091f4f41654365d2c29531.zip
wallet-core: various p2p payment fixes
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/common.ts14
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)}`);