wizard: raise more specific exc in create_storage() and pass some to crash reporter#10121
Merged
SomberNight merged 4 commits intospesmilo:masterfrom Feb 10, 2026
Merged
Conversation
33eb847 to
f92e9e5
Compare
f92e9e5 to
9f0d9c5
Compare
f321x
added a commit
to f321x/electrum-fork
that referenced
this pull request
Feb 4, 2026
I tried to reproduce: spesmilo#8815 (comment) which triggered the following exception for me: ``` Traceback (most recent call last): File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 409, in start_new_window window = self._create_window_for_wallet(wallet) File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 329, in _create_window_for_wallet w = ElectrumWindow(self, wallet) File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 290, in __init__ self.load_wallet(wallet) ~~~~~~~~~~~~~~~~^^^^^^^^ File "/home/user/code/electrum-fork/electrum/util.py", line 495, in do_profile o = func(*args, **kw_args) File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 589, in load_wallet self.update_recently_opened_menu() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 741, in update_recently_opened_menu for i, k in enumerate(recent): ~~~~~~~~~^^^^^^^^ TypeError: 'NoneType' object is not iterable ``` This happens because the trustedcoin wallet is loaded outside of Daemon.load_wallet() so Daemon.update_recently_opened_wallets() is not getting called and config.RECENTLY:_OPEN_WALLET_FILES is still None when we try to iterate through it. As fix i now call update_recently_opened_wallets directy in Daemon.add_wallet() and additionally handle RECENTLY_OPEN_WALLET_FILES being None in ElectrumWindow.update_recently_opened_menu(). My pull request spesmilo#10121 would have sent this exception to the crash reporter so we might have noticed it earlier. I think we should not just catch all exceptions in the wizard like on master as it causes us to repeatedly miss regressions in the wizard that could be sent to the crash reporter.
Modifies `NewWalletWizard.create_storage()` to raise more specific exception types instead of plain `Exception`. This should allow the calling GUI to separate between non-bug exceptions (like invalid user input), and bugs which should not happen and be passed to the bug reporter.
Differentiate between the `UserFacingException` and other exceptions when creating the storage. Forward other exceptions to the reporter so they can get fixed.
Differentiate between the `UserFacingException` and other exceptions when creating the storage. Forward other exceptions to the reporter so they can get fixed.
9f0d9c5 to
2fd74c1
Compare
SomberNight
approved these changes
Feb 10, 2026
Member
SomberNight
left a comment
There was a problem hiding this comment.
Thanks! I agree with the concept, we should distinguish bugs vs expected exceptions.
Comment on lines
421
to
423
| elif isinstance(e, WalletFileException) and e.should_report_crash \ | ||
| or not isinstance(e, WalletFileException): | ||
| send_exception_to_crash_reporter(e) |
Member
There was a problem hiding this comment.
Suggested change
| elif isinstance(e, WalletFileException) and e.should_report_crash \ | |
| or not isinstance(e, WalletFileException): | |
| send_exception_to_crash_reporter(e) | |
| else: | |
| send_exception_to_crash_reporter(e) |
f321x
added a commit
to f321x/electrum-fork
that referenced
this pull request
Feb 11, 2026
I tried to reproduce: spesmilo#8815 (comment) which triggered the following exception for me: ``` Traceback (most recent call last): File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 409, in start_new_window window = self._create_window_for_wallet(wallet) File "/home/user/code/electrum-fork/electrum/gui/qt/__init__.py", line 329, in _create_window_for_wallet w = ElectrumWindow(self, wallet) File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 290, in __init__ self.load_wallet(wallet) ~~~~~~~~~~~~~~~~^^^^^^^^ File "/home/user/code/electrum-fork/electrum/util.py", line 495, in do_profile o = func(*args, **kw_args) File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 589, in load_wallet self.update_recently_opened_menu() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/home/user/code/electrum-fork/electrum/gui/qt/main_window.py", line 741, in update_recently_opened_menu for i, k in enumerate(recent): ~~~~~~~~~^^^^^^^^ TypeError: 'NoneType' object is not iterable ``` This happens because the trustedcoin wallet is loaded outside of Daemon.load_wallet() so Daemon.update_recently_opened_wallets() is not getting called and config.RECENTLY:_OPEN_WALLET_FILES is still None when we try to iterate through it. As fix i now use load_wallet() instead of manually instantiating the Wallet and additionally handle RECENTLY_OPEN_WALLET_FILES being None in ElectrumWindow.update_recently_opened_menu(). My pull request spesmilo#10121 would have sent this exception to the crash reporter so we might have noticed it earlier. I think we should not just catch all exceptions in the wizard like on master as it causes us to repeatedly miss regressions in the wizard that could be sent to the crash reporter.
SomberNight
added a commit
that referenced
this pull request
Feb 26, 2026
wizard: raise more specific exc in create_storage() and pass some to crash reporter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the exceptions raised by
create_storage()are all plainExceptionand shown as warning in the GUI. This causes us to miss bugs like #10117 because they never get forwarded to the crash reporter.This PR makes the exception types of
create_storage()more specific,UserFacingExceptionare still shown to the user as before, but other exception types are caught in the calling GUI and forwarded to the crash reporter instead.