gnunet-svn
[Top][All Lists]
Advanced

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

[taler-typescript-core] branch master updated: wallet-core: use proper G


From: gnunet
Subject: [taler-typescript-core] branch master updated: wallet-core: use proper GANA error code when ToS download fails
Date: Tue, 14 Jan 2025 23:40:47 +0100

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

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

The following commit(s) were added to refs/heads/master by this push:
     new f119f4aae wallet-core: use proper GANA error code when ToS download 
fails
f119f4aae is described below

commit f119f4aae40623bb0c15f61f58a65a40ce233eab
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Jan 14 23:40:43 2025 +0100

    wallet-core: use proper GANA error code when ToS download fails
---
 packages/taler-wallet-core/src/exchanges.ts | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/packages/taler-wallet-core/src/exchanges.ts 
b/packages/taler-wallet-core/src/exchanges.ts
index 040a2cc84..f56e8817b 100644
--- a/packages/taler-wallet-core/src/exchanges.ts
+++ b/packages/taler-wallet-core/src/exchanges.ts
@@ -221,6 +221,18 @@ async function downloadExchangeWithTermsOfService(
     timeout,
     cancellationToken: wex.cancellationToken,
   });
+
+  if (
+    (resp.status >= 500 && resp.status <= 599) ||
+    (resp.status >= 400 && resp.status >= 499)
+  ) {
+    const innerError = await readTalerErrorResponse(resp);
+    throw TalerError.fromDetail(TalerErrorCode.WALLET_EXCHANGE_UNAVAILABLE, {
+      exchangeBaseUrl,
+      innerError,
+    });
+  }
+
   const tosText = await readSuccessResponseTextOrThrow(resp);
   const tosEtag = resp.headers.get("taler-terms-version") || "unknown";
   const tosContentLanguage = resp.headers.get("content-language") || undefined;

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