aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/withdraw.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-06-06 17:25:17 +0200
committerFlorian Dold <florian@dold.me>2023-06-06 17:25:17 +0200
commitd8d214942cc2544d46448811303cedf15809f5b3 (patch)
tree1df0b84fcf60d22b95f8418253d3c9b17c93dfa5 /packages/taler-wallet-core/src/operations/withdraw.ts
parent698f356659b1c2b029eaaa22c74f3474ff2f99c1 (diff)
downloadwallet-core-d8d214942cc2544d46448811303cedf15809f5b3.tar.xz
wallet-core: truncate withdrawal errors
Diffstat (limited to 'packages/taler-wallet-core/src/operations/withdraw.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/withdraw.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts
index 61cab6fbb..26149bd06 100644
--- a/packages/taler-wallet-core/src/operations/withdraw.ts
+++ b/packages/taler-wallet-core/src/operations/withdraw.ts
@@ -1426,6 +1426,8 @@ async function processWithdrawalGroupPendingReady(
let numKycRequired = 0;
let finishedForFirstTime = false;
const errorsPerCoin: Record<number, TalerErrorDetail> = {};
+ let numPlanchetErrors = 0;
+ const maxReportedErrors = 5;
const res = await ws.db
.mktx((x) => [x.coins, x.withdrawalGroups, x.planchets])
@@ -1445,7 +1447,10 @@ async function processWithdrawalGroupPendingReady(
numKycRequired++;
}
if (x.lastError) {
- errorsPerCoin[x.coinIdx] = x.lastError;
+ numPlanchetErrors++;
+ if (numPlanchetErrors < maxReportedErrors) {
+ errorsPerCoin[x.coinIdx] = x.lastError;
+ }
}
});
const oldTxState = computeWithdrawalTransactionStatus(wg);
@@ -1507,6 +1512,7 @@ async function processWithdrawalGroupPendingReady(
throw TalerError.fromDetail(
TalerErrorCode.WALLET_WITHDRAWAL_GROUP_INCOMPLETE,
{
+ numErrors: numPlanchetErrors,
errorsPerCoin,
},
`withdrawal did not finish (${numFinished} / ${numTotalCoins} coins withdrawn)`,