1
0

wizard,hw: tell user about errors during plugin init

see #4817 (issuecomment-434765570)
This commit is contained in:
SomberNight
2018-10-31 17:58:47 +01:00
parent 4f7283a3b0
commit 386e0d560e
3 changed files with 42 additions and 20 deletions

View File

@@ -165,18 +165,20 @@ def init_cmdline(config_options, server):
def get_connected_hw_devices(plugins):
support = plugins.get_hardware_support()
if not support:
print_msg('No hardware wallet support found on your system.')
sys.exit(1)
supported_plugins = plugins.get_hardware_support()
# scan devices
devices = []
devmgr = plugins.device_manager
for name, description, plugin in support:
for splugin in supported_plugins:
name, plugin = splugin.name, splugin.plugin
if not plugin:
e = splugin.exception
print_stderr(f"{name}: error during plugin init: {repr(e)}")
continue
try:
u = devmgr.unpaired_device_infos(None, plugin)
except:
devmgr.print_error("error", name)
devmgr.print_error(f'error getting device infos for {name}: {e}')
continue
devices += list(map(lambda x: (name, x), u))
return devices