[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-bank] branch master updated: exception objects strin
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-bank] branch master updated: exception objects stringification |
Date: |
Wed, 29 Nov 2017 12:16:12 +0100 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository bank.
The following commit(s) were added to refs/heads/master by this push:
new 27b6af1 exception objects stringification
27b6af1 is described below
commit 27b6af166faabd9f64a274a380b0c7f07ac376fc
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Nov 29 12:15:51 2017 +0100
exception objects stringification
---
talerbank/app/amount.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/talerbank/app/amount.py b/talerbank/app/amount.py
index 6c17610..0453c35 100644
--- a/talerbank/app/amount.py
+++ b/talerbank/app/amount.py
@@ -23,11 +23,16 @@
# which might need it.
class CurrencyMismatch(Exception):
- pass
+ def __init__(self, msg):
+ self.msg = msg
+ def __str__(self):
+ return self.msg
class BadFormatAmount(Exception):
def __init__(self, faulty_str):
self.faulty_str = faulty_str
+ def __str__(self):
+ return self.faulty_str
class Amount:
# How many "fraction" units make one "value" unit of currency
@@ -77,7 +82,7 @@ class Amount:
@staticmethod
def cmp(am1, am2):
if am1.currency != am2.currency:
- raise CurrencyMismatch()
+ raise CurrencyMismatch("%s vs %s" % (am1.currency, am2.currency))
if am1.value == am2.value:
if am1.fraction < am2.fraction:
return -1
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-bank] branch master updated: exception objects stringification,
gnunet <=