[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: catch err
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontends] branch master updated: catch error from attempting to parse non json |
Date: |
Tue, 30 May 2017 15:18:27 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontends.
The following commit(s) were added to refs/heads/master by this push:
new ba1f72c catch error from attempting to parse non json
ba1f72c is described below
commit ba1f72cc6a0943c5111fc3509688898c468906e9
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue May 30 15:17:58 2017 +0200
catch error from attempting to parse non json
---
talerfrontends/blog/blog.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/talerfrontends/blog/blog.py b/talerfrontends/blog/blog.py
index af88d12..df8ab8b 100644
--- a/talerfrontends/blog/blog.py
+++ b/talerfrontends/blog/blog.py
@@ -103,7 +103,10 @@ def generate_contract():
)
r = requests.post(urljoin(BACKEND_URL, 'proposal'), json=dict(order=order))
if r.status_code != 200:
- return flask.jsonify(r.json()), r.status_code
+ try:
+ return flask.jsonify(r.json()), r.status_code
+ except json.decoder.JSONDecodeError:
+ return flask.jsonify(dict(error="Backend died, no JSON got from
it")), 502
proposal_resp = r.json()
return flask.jsonify(**proposal_resp)
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontends] branch master updated: catch error from attempting to parse non json,
gnunet <=