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 messages.


From: gnunet
Subject: [taler-taler-merchant-demos] branch master updated: Error messages.
Date: Thu, 01 Jul 2021 07:34:22 +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 9c981d8  Error messages.
9c981d8 is described below

commit 9c981d81d251b2a2e1c71cdc957af728b3b0968c
Author: ms <ms@taler.net>
AuthorDate: Tue Jun 29 21:28:49 2021 +0200

    Error messages.
    
    Giving user friendlier error messages when the tip reserve
    was never created, or ran out of money.
---
 talermerchantdemos/survey/survey.py                    | 18 ++++++++++++++++++
 .../templates/survey-error-graceful.html.j2            |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/talermerchantdemos/survey/survey.py 
b/talermerchantdemos/survey/survey.py
index b25d6e5..57acb1d 100644
--- a/talermerchantdemos/survey/survey.py
+++ b/talermerchantdemos/survey/survey.py
@@ -173,6 +173,24 @@ def handler_405(e):
 
 @app.errorhandler(BackendException)
 def handler_backend_exception(e):
+
+    # The tip reserve was never created
+    if e.backend_json.get("code") == 2753:
+        t = flask.render_template(
+            "survey-error-graceful.html.j2",
+            message="Tip money were never invested, we are sorry!"
+        )
+        return flask.make_response(t, 500)
+
+    # The tip reserve was never created
+    if e.backend_json.get("code") == 2752:
+        t = flask.render_template(
+            "survey-error-graceful.html.j2",
+            message="Tip money got all given, please return later!"
+        )
+        return flask.make_response(t, 500)
+
+
     t = flask.render_template(
         "survey-error.html.j2",
         message=e.args[0],
diff --git a/talermerchantdemos/templates/survey-error-graceful.html.j2 
b/talermerchantdemos/templates/survey-error-graceful.html.j2
new file mode 100644
index 0000000..ece2252
--- /dev/null
+++ b/talermerchantdemos/templates/survey-error-graceful.html.j2
@@ -0,0 +1,7 @@
+{% extends "survey-base.html.j2" %}
+{% block main %}
+  <h1>{{ gettext("Unexpected result") }}</h1>
+
+  <p>{{ message }}</p>
+
+{% endblock main %}

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