gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: wallet-core: truncate withdra


From: gnunet
Subject: [taler-wallet-core] branch master updated: wallet-core: truncate withdrawal errors
Date: Tue, 06 Jun 2023 17:25:20 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new d8d214942 wallet-core: truncate withdrawal errors
d8d214942 is described below

commit d8d214942cc2544d46448811303cedf15809f5b3
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Jun 6 17:25:17 2023 +0200

    wallet-core: truncate withdrawal errors
---
 packages/taler-util/src/errors.ts                     | 1 +
 packages/taler-wallet-core/src/operations/withdraw.ts | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/packages/taler-util/src/errors.ts 
b/packages/taler-util/src/errors.ts
index c709c9a4c..8476b63fc 100644
--- a/packages/taler-util/src/errors.ts
+++ b/packages/taler-util/src/errors.ts
@@ -98,6 +98,7 @@ export interface DetailsMap {
   };
   [TalerErrorCode.WALLET_EXCHANGE_COIN_SIGNATURE_INVALID]: empty;
   [TalerErrorCode.WALLET_WITHDRAWAL_GROUP_INCOMPLETE]: {
+    numErrors: number,
     errorsPerCoin: Record<number, TalerErrorDetail>;
   };
   [TalerErrorCode.WALLET_CORE_NOT_AVAILABLE]: empty;
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)`,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]