gnunet-svn
[Top][All Lists]
Advanced

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

[taler-bank] branch master updated: error handling


From: gnunet
Subject: [taler-bank] branch master updated: error handling
Date: Wed, 05 Aug 2020 14:23:15 +0200

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

dold pushed a commit to branch master
in repository bank.

The following commit(s) were added to refs/heads/master by this push:
     new 7aa2b2f  error handling
7aa2b2f is described below

commit 7aa2b2f1c088da52540d55877edd7921cc55ed54
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Wed Aug 5 17:52:51 2020 +0530

    error handling
---
 talerbank/app/middleware.py | 5 +++--
 talerbank/app/views.py      | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/talerbank/app/middleware.py b/talerbank/app/middleware.py
index 093ff20..eeb6a67 100644
--- a/talerbank/app/middleware.py
+++ b/talerbank/app/middleware.py
@@ -95,17 +95,18 @@ class ExceptionMiddleware:
         if so.  Otherwise, it lets the native handler operate.
         """
         LOGGER.error(f"Error: {exception}, while serving 
{request.get_full_path()}")
+        LOGGER.error(f"Stack trace: {traceback.format_exc()}")
 
         if hasattr(exception, "taler_error_code"):
             render_to = self.render.get(request.path)
 
             if not render_to:
                 return JsonResponse(
-                    {"ec": exception.taler_error_code, "error": 
exception.hint},
+                    {"code": exception.taler_error_code, "error": 
exception.hint},
                     status=exception.http_status_code,
                 )
             set_profile_hint(request, failure=True, success=False, 
hint=exception.hint)
             return redirect(render_to)
         else:
-            return JsonResponse(dict(hint="unexpected exception", 
exception=str(exception)), status=500)
+            return JsonResponse(dict(code=5300, hint="unexpected exception", 
exception=str(exception)), status=500)
 
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 0b25c3d..b450fc7 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -1029,7 +1029,7 @@ def api_withdraw_operation(request, withdraw_id):
             exchange_user = User.objects.get(username=exchange_account_name)
         except User.DoesNotExist:
             return JsonResponse(
-                dict(error="bank account in payto URI unknown"), status=400
+                dict(code=5110, hint="bank account in payto URI unknown"), 
status=400
             )
         exchange_account = exchange_user.bankaccount
         selected_reserve_pub = data.get("reserve_pub")
@@ -1052,7 +1052,7 @@ def api_withdraw_operation(request, withdraw_id):
                     # Confirmation already happened, we still need to transfer 
funds!
                     wire_transfer(
                         op.amount,
-                        user_account,
+                        op.withdraw_account,
                         op.selected_exchange_account,
                         op.selected_reserve_pub,
                     )

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