contacts: use specific Exception when alias not found
This commit is contained in:
@@ -33,6 +33,11 @@ from .util import read_json_file, write_json_file, to_string
|
|||||||
from .logging import Logger
|
from .logging import Logger
|
||||||
from .util import trigger_callback
|
from .util import trigger_callback
|
||||||
|
|
||||||
|
|
||||||
|
class AliasNotFoundException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Contacts(dict, Logger):
|
class Contacts(dict, Logger):
|
||||||
|
|
||||||
def __init__(self, db):
|
def __init__(self, db):
|
||||||
@@ -94,7 +99,7 @@ class Contacts(dict, Logger):
|
|||||||
'type': 'openalias',
|
'type': 'openalias',
|
||||||
'validated': validated
|
'validated': validated
|
||||||
}
|
}
|
||||||
raise Exception("Invalid Bitcoin address or alias", k)
|
raise AliasNotFoundException("Invalid Bitcoin address or alias", k)
|
||||||
|
|
||||||
def fetch_openalias(self, config):
|
def fetch_openalias(self, config):
|
||||||
self.alias_info = None
|
self.alias_info = None
|
||||||
|
|||||||
Reference in New Issue
Block a user