thww wizard: better handle UserFacingException in one case - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit c0b170acb7e32add65284223329137ed8bc7245d (DIR) parent e68b6447cc3457b5151c148873fbd82b8d0a1f49 (HTM) Author: SomberNight <somber.night@protonmail.com> Date: Wed, 1 Apr 2020 16:36:41 +0200 hww wizard: better handle UserFacingException in one case E | gui.qt.installwizard.InstallWizard | Traceback (most recent call last): File "...\electrum\electrum\base_wizard.py", line 340, in on_device self.plugin.setup_device(device_info, self, purpose) File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 719, in setup_device client.get_xpub("m/44'/0'", 'standard') File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 120, in get_xpub reply = self._get_xpub(bip32_path) File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 114, in _get_xpub if self.check_device_dialog(): File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 223, in check_device_dialog self.recover_or_erase_dialog() # Already seeded File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 244, in recover_or_erase_dialog if not self.dbb_load_backup(): File "...\electrum\electrum\plugins\digitalbitbox\digitalbitbox.py", line 340, in dbb_load_backup raise UserFacingException(backups['error']['message']) electrum.util.UserFacingException: Please insert SD card. Diffstat: M electrum/base_wizard.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- (DIR) diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py t@@ -40,7 +40,7 @@ from .wallet import (Imported_Wallet, Standard_Wallet, Multisig_Wallet, from .storage import WalletStorage, StorageEncryptionVersion from .wallet_db import WalletDB from .i18n import _ -from .util import UserCancelled, InvalidPassword, WalletFileException +from .util import UserCancelled, InvalidPassword, WalletFileException, UserFacingException from .simple_config import SimpleConfig from .plugin import Plugins, HardwarePluginLibraryUnavailable from .logging import Logger t@@ -356,6 +356,10 @@ class BaseWizard(Logger): except (UserCancelled, GoBack): self.choose_hw_device(purpose, storage=storage) return + except UserFacingException as e: + self.show_error(str(e)) + self.choose_hw_device(purpose, storage=storage) + return except BaseException as e: self.logger.exception('') self.show_error(str(e))