hw plugins: coldcard: log error when I forget to set udev rules
What changed, and why it matters
This commit only adds a more helpful error message when the Coldcard hardware wallet cannot be opened because of missing Linux USB device permissions (udev rules). It does not change any security behavior, permissions, or access controls; it simply logs a hint before re-raising the same error.
No security action required; this is a routine developer-experience/logging change.
Security signals we found
No security-relevant code change
Exception handling added purely for improved error messaging
Original exception re-raised without modification
Evidence from the diff
In electrum/plugins/coldcard/coldcard.py, the existing hd.open_path(dev_path) call is wrapped in a try/except OSError block. On OSError, a logger.error() message suggesting a udev-rules misconfiguration is emitted, and the original exception is re-raised unchanged. No functional behavior is altered; this is a diagnostic UX improvement.
Changed components
electrum/plugins/coldcard/coldcard.pyInspect captured patch +5 / −1
diff --git a/electrum/plugins/coldcard/coldcard.py b/electrum/plugins/coldcard/coldcard.py
index 2fa5f4b..46d3c5f 100644
--- a/electrum/plugins/coldcard/coldcard.py
+++ b/electrum/plugins/coldcard/coldcard.py
@@ -72,7 +72,11 @@ class CKCCClient(HardwareClientBase):
else:
# open the real HID device
hd = hid.device(path=dev_path)
- hd.open_path(dev_path)
+ try:
+ hd.open_path(dev_path)
+ except OSError:
+ _logger.error('cannot open hid path. Did you forget to configure udev rules?')
+ raise
self.dev = ElectrumColdcardDevice(dev=hd, encrypt=True)
Why this scored 16/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.