diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py index 4a37fb100..e6fef17a7 100644 --- a/electrum/gui/qt/__init__.py +++ b/electrum/gui/qt/__init__.py @@ -70,7 +70,7 @@ from electrum.i18n import _, set_language from electrum.plugin import run_hook from electrum.util import (UserCancelled, profiler, send_exception_to_crash_reporter, WalletFileException, get_new_wallet_name, InvalidPassword, - standardize_path) + standardize_path, UserFacingException) from electrum.wallet import Wallet, Abstract_Wallet from electrum.wallet_db import WalletRequiresSplit, WalletRequiresUpgrade, WalletUnfinished from electrum.gui import BaseElectrumGui @@ -411,12 +411,15 @@ class ElectrumGui(BaseElectrumGui, Logger): return except Exception as e: self.logger.exception('') - err_text = str(e) if isinstance(e, WalletFileException) else repr(e) - custom_message_box(icon=QMessageBox.Icon.Warning, - parent=None, - title=_('Error'), - text=_('Cannot load wallet') + '(2) :\n' + err_text) - if isinstance(e, WalletFileException) and e.should_report_crash: + if isinstance(e, UserFacingException) \ + or isinstance(e, WalletFileException) and not e.should_report_crash: + err_text = str(e) if isinstance(e, WalletFileException) else repr(e) + custom_message_box(icon=QMessageBox.Icon.Warning, + parent=None, + title=_('Error'), + text=_('Cannot load wallet') + '(2) :\n' + err_text) + elif isinstance(e, WalletFileException) and e.should_report_crash \ + or not isinstance(e, WalletFileException): send_exception_to_crash_reporter(e) if app_is_starting: # If we raise in this context, there are no more fallbacks, we will shut down.