1
0

qt wizard bip39 recovery: better handle --offline mode

```
 32.40 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/wizard/wallet.py", line 709, in <lambda>
    button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))
  File "/home/user/wspace/electrum/electrum/gui/qt/bip39_recovery_dialog.py", line 40, in __init__
    fut = asyncio.run_coroutine_threadsafe(coro, network.asyncio_loop)
AttributeError: 'NoneType' object has no attribute 'asyncio_loop'
```
This commit is contained in:
SomberNight
2023-12-01 17:37:58 +00:00
parent 5d178d3a7c
commit 64f82cd260
5 changed files with 26 additions and 7 deletions

View File

@@ -204,6 +204,14 @@ class UserFacingException(Exception):
class InvoiceError(UserFacingException): pass
class NetworkOfflineException(UserFacingException):
"""Can be raised if we are running in offline mode (--offline flag)
and the user requests an operation that requires the network.
"""
def __str__(self):
return _("You are offline.")
# Throw this exception to unwind the stack like when an error occurs.
# However unlike other exceptions the user won't be informed.
class UserCancelled(Exception):