From 3000b83ab5a226d56578f20d443c0a8cf8ac682e Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 1 Jun 2023 14:51:38 +0200 Subject: [PATCH] contacts: use specific Exception when alias not found --- electrum/contacts.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/electrum/contacts.py b/electrum/contacts.py index cc7906554..fd941bfc8 100644 --- a/electrum/contacts.py +++ b/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