diff options
Diffstat (limited to 'talerbank/app/middleware.py')
-rw-r--r-- | talerbank/app/middleware.py | 16 |
1 files 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 |