summaryrefslogtreecommitdiff
path: root/talerbank/app/views.py
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-11-16 03:10:17 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-11-16 03:10:17 +0100
commitfd5b3e7df26690169bb420f81e27a266a8c5d17b (patch)
treea8ffa696184fbe699fbc7eb0a17dd5680a3f1c48 /talerbank/app/views.py
parent0cec89e017418c75c2924c280461643d5e6a0532 (diff)
downloadbank-fd5b3e7df26690169bb420f81e27a266a8c5d17b.tar.gz
bank-fd5b3e7df26690169bb420f81e27a266a8c5d17b.tar.bz2
bank-fd5b3e7df26690169bb420f81e27a266a8c5d17b.zip
Closing #5788 and shortening middleware code.
Diffstat (limited to 'talerbank/app/views.py')
-rw-r--r--talerbank/app/views.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/talerbank/app/views.py b/talerbank/app/views.py
index 426937e..d4c1872 100644
--- a/talerbank/app/views.py
+++ b/talerbank/app/views.py
@@ -68,7 +68,7 @@ UINT64_MAX = (2**64) - 1
class LoginFailed(Exception):
hint = "Wrong username/password"
http_status_code = 401
-
+ taler_error_code = 5109
class InvalidInputData(Exception):
def __init__(self, msg):
@@ -93,6 +93,7 @@ class PrivateAccountException(Exception):
class DebitLimitException(Exception):
hint = "Insufficient credit, operation not acceptable."
http_status_code = 406
+ taler_error_code = 5103
##
@@ -102,6 +103,7 @@ class DebitLimitException(Exception):
class SameAccountException(Exception):
hint = "Debit and credit account are the same."
http_status_code = 403
+ taler_error_code = 5102
##
@@ -112,6 +114,14 @@ class RejectNoRightsException(Exception):
hint = "You weren't the transaction credit account, " \
"no rights to reject."
http_status_code = 403
+ taler_error_code = 5200
+
+class UnhandledException(Exception):
+ hint = "Unhandled exception happened!"
+ http_status_code = 500
+ taler_error_code = 5300
+
+
##