summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2019-02-05 16:17:52 +0100
committerMarcello Stanisci <stanisci.m@gmail.com>2019-03-29 18:03:54 +0100
commit1192d66c29cddf3a0032ffb40f9473a93d175993 (patch)
tree1d6b662cf0704b39273ee0cd2f485face6c81ca6
parenta475bd0fede9a3008fb4ffbdac2aad0c0580a6ab (diff)
downloadbank-1192d66c29cddf3a0032ffb40f9473a93d175993.tar.gz
bank-1192d66c29cddf3a0032ffb40f9473a93d175993.tar.bz2
bank-1192d66c29cddf3a0032ffb40f9473a93d175993.zip
providing the 'hint' field to those exeptions missing it.
-rw-r--r--talerbank/app/amount.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/talerbank/app/amount.py b/talerbank/app/amount.py
index 588b6b6..04fad51 100644
--- a/talerbank/app/amount.py
+++ b/talerbank/app/amount.py
@@ -46,8 +46,9 @@ class CurrencyMismatch(Exception):
##
# Exception class to raise when a amount string is not valid.
class BadFormatAmount(Exception):
- hint = "Amount given was incorrect"
-
+
+ hint = "Malformed amount string"
+
##
# Init constructor.
#
@@ -60,14 +61,16 @@ class BadFormatAmount(Exception):
##
# Main Amount class.
class NumberTooBig(Exception):
+ hint = "NUmber given is too big"
def __init__(self) -> None:
super(NumberTooBig, self).__init__(
- "Number given is too big!")
+ "Number given is too big")
class NegativeNumber(Exception):
+ hint = "Negative number given as value and/or fraction"
def __init__(self) -> None:
super(NegativeNumber, self).__init__(
- "Negative number given as value and/or fraction!")
+ "Negative number given as value and/or fraction")
class Amount:
##