aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-11-02 14:23:26 +0100
committerFlorian Dold <florian@dold.me>2022-11-02 14:23:26 +0100
commit1e6e1a22cdb16975f3a914b2f1be6db0ae1b241d (patch)
treeef3b0bcf0d8c8bf8bd3fd2082b53d450f7a09f11 /packages/taler-wallet-core/src/operations/exchanges.ts
parentfe011321a4b65bc0736634ee2a4d9c7bf0618351 (diff)
downloadwallet-core-1e6e1a22cdb16975f3a914b2f1be6db0ae1b241d.tar.xz
wallet-core: fix exchange management test case, surface exchange update error info in list
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts
index 41e63b956..23ff1479e 100644
--- a/packages/taler-wallet-core/src/operations/exchanges.ts
+++ b/packages/taler-wallet-core/src/operations/exchanges.ts
@@ -73,9 +73,11 @@ import {
import {
OperationAttemptResult,
OperationAttemptResultType,
- runOperationHandlerForResult,
+ RetryTags,
+ unwrapOperationHandlerResultOrThrow,
} from "../util/retries.js";
import { WALLET_EXCHANGE_PROTOCOL_VERSION } from "../versions.js";
+import { runOperationWithErrorReporting } from "./common.js";
import { isWithdrawableDenom } from "./withdraw.js";
const logger = new Logger("exchanges.ts");
@@ -546,8 +548,13 @@ export async function updateExchangeFromUrl(
exchange: ExchangeRecord;
exchangeDetails: ExchangeDetailsRecord;
}> {
- return runOperationHandlerForResult(
- await updateExchangeFromUrlHandler(ws, baseUrl, options),
+ const canonUrl = canonicalizeBaseUrl(baseUrl);
+ return unwrapOperationHandlerResultOrThrow(
+ await runOperationWithErrorReporting(
+ ws,
+ RetryTags.forExchangeUpdateFromUrl(canonUrl),
+ () => updateExchangeFromUrlHandler(ws, canonUrl, options),
+ ),
);
}