gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-bank] 03/12: Handling new exeption within the middle


From: gnunet
Subject: [GNUnet-SVN] [taler-bank] 03/12: Handling new exeption within the middleware.
Date: Fri, 29 Mar 2019 18:08:22 +0100

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

marcello pushed a commit to branch master
in repository bank.

commit a475bd0fede9a3008fb4ffbdac2aad0c0580a6ab
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Feb 5 16:15:09 2019 +0100

    Handling new exeption within the middleware.
---
 talerbank/app/middleware.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/talerbank/app/middleware.py b/talerbank/app/middleware.py
index 214a21e..a5888e2 100644
--- a/talerbank/app/middleware.py
+++ b/talerbank/app/middleware.py
@@ -7,8 +7,10 @@ from .views import \
      LoginFailed, RejectNoRightsException)
 from .schemas import \
     (URLParameterMissing, URLParameterMalformed,
-     JSONFieldException)
-from .amount import CurrencyMismatch, BadFormatAmount
+     JSONFieldException, UnknownCurrencyException)
+from .amount import \
+    (CurrencyMismatch, BadFormatAmount,
+     NumberTooBig, NegativeNumber)
 
 LOGGER = logging.getLogger()
 
@@ -41,12 +43,15 @@ class ExceptionMiddleware:
             CurrencyMismatch: 11,
             BadFormatAmount: 11,
             LoginFailed: 12,
-            RejectNoRightsException: 13}
-
+            RejectNoRightsException: 13,
+            UnknownCurrencyException: 14,
+            NumberTooBig: 1,
+            NegativeNumber: 0}
 
         # List of all the HTTP endpoint that are likely
         # to generate exceptions.
         self.apis = {
+            "/withdraw": 5400,
             "/reject": 5300,
             "/history": 5200,
             "/admin/add/incoming": 5100}
@@ -58,7 +63,8 @@ class ExceptionMiddleware:
             "/profile": "profile",
             "/register": "index",
             "/public-accounts": "index",
-            "/pin/verify": "profile"}
+            "/pin/verify": "profile",
+            "/withdraw": "profile"}
 
     ##
     # This function is transparently invoked by Django when

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]