qt: show StorageReadWriteError to user instead of crash reporting it
What changed, and why it matters
This is a small user-interface fix in Electrum's Qt desktop app. Previously, if the wallet file was on a read-only folder or an unplugged drive, the app treated the resulting StorageReadWriteError as an unexpected crash and sent a crash report. Now it shows a friendly warning message to the user instead. It is a quality-of-life improvement, not a security vulnerability fix.
No security action required. Treat as a normal bugfix or UX improvement. If crash reports for read-only/unplugged-drive cases were previously noisy, this change reduces false-positive reports.
Security signals we found
No memory safety, cryptographic, or authorization changes
Exception handling change only; no new attack surface introduced
Crash-reporting no longer triggered for expected I/O failure scenarios
Evidence from the diff
The commit adds StorageReadWriteError to the list of exceptions handled as user-facing errors in electrum/gui/qt/init.py’s __handle_wallet_loading_exc. Before, StorageReadWriteError fell through to the generic crash-reporting path. After the change, it is shown in a warning dialog and not reported as a crash. There is no change to file permissions, storage logic, or cryptographic handling.
Changed components
electrum/gui/qt/__init__.pyInspect captured patch +2 / −1
### electrum/gui/qt/__init__.py
@@ -73,6 +73,7 @@
standardize_path, UserFacingException)
from electrum.wallet import Wallet, Abstract_Wallet
from electrum.wallet_db import WalletRequiresSplit, WalletRequiresUpgrade, WalletUnfinished
+from electrum.storage import StorageReadWriteError
from electrum.gui import BaseElectrumGui
from electrum.simple_config import SimpleConfig
from electrum.wizard import WizardViewState
@@ -403,7 +404,7 @@ def start_new_window(
return None
def __handle_wallet_loading_exc(exc: Exception, pos):
- if isinstance(exc, UserFacingException) \
+ if isinstance(exc, (UserFacingException, StorageReadWriteError)) \
or isinstance(exc, WalletFileException) and not exc.should_report_crash:
self.logger.exception(f"{pos=}")
custom_message_box(icon=QMessageBox.Icon.Warning,Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.