gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-merchant-demos] branch master updated: error management


From: gnunet
Subject: [taler-taler-merchant-demos] branch master updated: error management
Date: Thu, 31 Mar 2022 15:40:05 +0200

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

ms pushed a commit to branch master
in repository taler-merchant-demos.

The following commit(s) were added to refs/heads/master by this push:
     new 2626ecc  error management
2626ecc is described below

commit 2626ecc64d373dfaccfd2eb365c4744d52689360
Author: ms <ms@taler.net>
AuthorDate: Thu Mar 31 15:40:01 2022 +0200

    error management
---
 talermerchantdemos/httpcommon/__init__.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/talermerchantdemos/httpcommon/__init__.py 
b/talermerchantdemos/httpcommon/__init__.py
index b9d7e35..0584cba 100644
--- a/talermerchantdemos/httpcommon/__init__.py
+++ b/talermerchantdemos/httpcommon/__init__.py
@@ -14,7 +14,7 @@ LOGGER = logging.getLogger(__name__)
 class BackendException(Exception):
     """Exception for failed communication with the Taler merchant backend"""
 
-    def __init__(self, message, backend_status=None, backend_json=None):
+    def __init__(self, message, backend_status=None, backend_json={}):
         super().__init__(backend_json.get("hint", message))
         self.backend_status = backend_status
         self.backend_json = backend_json
@@ -41,9 +41,9 @@ def backend_post(backend_url, endpoint, json, 
auth_token=None):
         )
     try:
         response_json = resp.json()
-    except ValueError:
+    except Exception:
         raise BackendException(
-            message=gettext("Could not parse response from backend"),
+            message=gettext("Could not parse the response from backend"),
             backend_status=resp.status_code,
         )
     if resp.status_code != 200:
@@ -81,7 +81,7 @@ def backend_get(backend_url, endpoint, params, 
auth_token=None):
         )
     try:
         response_json = resp.json()
-    except ValueError:
+    except Exception:
         raise BackendException(message=gettext("Could not parse response from 
backend"))
     if resp.status_code != 200:
         raise BackendException(

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