diff options
author | MS <ms@taler.net> | 2020-11-17 16:27:17 +0100 |
---|---|---|
committer | MS <ms@taler.net> | 2020-11-17 16:27:17 +0100 |
commit | c27a9c16820a21711d397ec7348ad5e398631f87 (patch) | |
tree | e92b563da8ff64e4646eacbadcfe9d9fe8a12d2d /talerbank/app/views.py | |
parent | 354f6f6608eb14e8fd27669f08d8eabacd35098f (diff) | |
download | bank-c27a9c16820a21711d397ec7348ad5e398631f87.tar.gz bank-c27a9c16820a21711d397ec7348ad5e398631f87.tar.bz2 bank-c27a9c16820a21711d397ec7348ad5e398631f87.zip |
Improve wire_transfer_payto CLI tool.
Diffstat (limited to 'talerbank/app/views.py')
-rw-r--r-- | talerbank/app/views.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/talerbank/app/views.py b/talerbank/app/views.py index 1ac0c99..7177d7f 100644 --- a/talerbank/app/views.py +++ b/talerbank/app/views.py @@ -99,6 +99,10 @@ def allow_origin_star(view_func): return wraps(view_func)(_decorator) +class PaytoFormatError(Exception): + def __init__(self, msg): + super(PaytoFormatError, self).__init__(msg) + self.msg = msg class PaytoParse: def __init__(self, payto_uri): @@ -108,7 +112,7 @@ class PaytoParse: len(path) != 3 or \ not obj.netloc or \ not re.match("^payto://", payto_uri): - raise Exception(f"Bad Payto URI: {payto_uri}") + raise PaytoFormatError(f"Bad Payto URI: {payto_uri}") self.target = path.pop() self.bank = path.pop() self.authority = obj.netloc |