qml: wizard: differentiate between create_storage exc types
What changed, and why it matters
This commit changes how the Electrum mobile/QML wallet wizard handles errors when creating a new wallet file. Previously, all errors were shown to the user as a simple message. Now, normal user-facing errors (like a bad password or existing file) are still shown to the user, while unexpected programming errors are sent to Electrum's crash reporter. This is a defensive improvement that helps developers find and fix bugs, but it does not itself fix a known security vulnerability.
No immediate action required. Treat as a routine maintainability/defensive change. Monitor crash reporter output for newly reported storage creation failures.
Security signals we found
Crash reporter now receives unexpected exceptions from wallet creation
User-facing errors are separated from internal/programming errors
No change to cryptographic, storage, or authentication logic
Evidence from the diff
In electrum/gui/qml/qewizard.py, the create_storage exception handler is split into two branches. UserFacingException is caught first and emitted via createError to the user interface. All other exceptions are now logged and forwarded to send_exception_to_crash_reporter. The change improves telemetry for unhandled failures during wallet storage creation but does not alter the storage creation logic or fix a specific bug.
Changed components
electrum/gui/qml/qewizard.pyQENewWalletWizard.create_storageInspect captured patch +6 / −2
diff --git a/electrum/gui/qml/qewizard.py b/electrum/gui/qml/qewizard.py
index cd45e9e..ca1961f 100644
--- a/electrum/gui/qml/qewizard.py
+++ b/electrum/gui/qml/qewizard.py
@@ -3,11 +3,12 @@ from typing import TYPE_CHECKING
from PyQt6.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject
+from electrum.base_crash_reporter import send_exception_to_crash_reporter
from electrum.logging import get_logger
from electrum import mnemonic
from electrum.wizard import NewWalletWizard, ServerConnectWizard, TermsOfUseWizard
from electrum.storage import WalletStorage, StorageReadWriteError
-from electrum.util import WalletFileException
+from electrum.util import WalletFileException, UserFacingException
from electrum.gui import messages
if TYPE_CHECKING:
@@ -172,9 +173,12 @@ class QENewWalletWizard(NewWalletWizard, QEAbstractWizard):
self.path = path
self.createSuccess.emit()
+ except UserFacingException as e:
+ self._logger.debug(f"createStorage errored: {e!r}", exc_info=True)
+ self.createError.emit(str(e))
except Exception as e:
self._logger.exception(f"createStorage errored: {e!r}")
- self.createError.emit(str(e))
+ send_exception_to_crash_reporter(e)
class QEServerConnectWizard(ServerConnectWizard, QEAbstractWizard):
Why this scored 21/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.