Browse Source

contacts: use specific Exception when alias not found

master
Sander van Grieken 3 years ago
parent
commit
3000b83ab5
  1. 7
      electrum/contacts.py

7
electrum/contacts.py

@ -33,6 +33,11 @@ from .util import read_json_file, write_json_file, to_string
from .logging import Logger
from .util import trigger_callback
class AliasNotFoundException(Exception):
pass
class Contacts(dict, Logger):
def __init__(self, db):
@ -94,7 +99,7 @@ class Contacts(dict, Logger):
'type': 'openalias',
'validated': validated
}
raise Exception("Invalid Bitcoin address or alias", k)
raise AliasNotFoundException("Invalid Bitcoin address or alias", k)
def fetch_openalias(self, config):
self.alias_info = None

Loading…
Cancel
Save