Browse Source

hw wallets: improve error message when a dependency is missing

e.g.
```
Debug message
  jade: (error getting device infos)
    Missing libraries for jade.
        ModuleNotFoundError("No module named 'cbor'")
    Make sure you install it with python3
```
patch-4
SomberNight 2 years ago
parent
commit
16c84acb98
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/plugins/hw_wallet/plugin.py

6
electrum/plugins/hw_wallet/plugin.py

@ -157,7 +157,11 @@ class HW_PluginBase(BasePlugin):
or versiontuple(library_version) < self.minimum_library
or versiontuple(library_version) >= self.maximum_library):
raise LibraryFoundButUnusable(library_version=library_version)
except ImportError:
except ImportError as e:
self.libraries_available_message = (
_("Missing libraries for {}.").format(self.name)
+ f"\n {e!r}"
)
return False
except LibraryFoundButUnusable as e:
library_version = e.library_version

Loading…
Cancel
Save