gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 02/02: wallet-core: also check EC of melt response b


From: gnunet
Subject: [taler-wallet-core] 02/02: wallet-core: also check EC of melt response before aborting
Date: Mon, 27 May 2024 21:54:50 +0200

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

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

commit db45b25fe871de42a68a4303b6eb31aa6da64f9b
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon May 27 21:54:31 2024 +0200

    wallet-core: also check EC of melt response before aborting
---
 packages/taler-wallet-core/src/refresh.ts | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/packages/taler-wallet-core/src/refresh.ts 
b/packages/taler-wallet-core/src/refresh.ts
index 7800967e6..38b8b097c 100644
--- a/packages/taler-wallet-core/src/refresh.ts
+++ b/packages/taler-wallet-core/src/refresh.ts
@@ -68,6 +68,7 @@ import {
   WalletNotification,
 } from "@gnu-taler/taler-util";
 import {
+  HttpResponse,
   readSuccessResponseJsonOrThrow,
   readTalerErrorResponse,
   throwUnexpectedRequestError,
@@ -693,7 +694,7 @@ async function refreshMelt(
   switch (resp.status) {
     case HttpStatusCode.NotFound: {
       const errDetail = await readTalerErrorResponse(resp);
-      await handleRefreshMeltNotFound(ctx, coinIndex, errDetail);
+      await handleRefreshMeltNotFound(ctx, coinIndex, resp, errDetail);
       return;
     }
     case HttpStatusCode.Gone: {
@@ -898,9 +899,17 @@ async function handleRefreshMeltConflict(
 async function handleRefreshMeltNotFound(
   ctx: RefreshTransactionContext,
   coinIndex: number,
+  resp: HttpResponse,
   errDetails: TalerErrorDetail,
 ): Promise<void> {
-  // FIXME: Validate the exchange's error response
+  // Make sure that we only act on a 404 that indicates a final problem
+  // with the coin.
+  switch (errDetails.code) {
+    case TalerErrorCode.EXCHANGE_GENERIC_COIN_UNKNOWN:
+      break;
+    default:
+      throwUnexpectedRequestError(resp, errDetails);
+  }
   await ctx.wex.db.runReadWriteTx(
     {
       storeNames: [

-- 
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]