Browse Source

plugins: somewhat clearer exception is loading plugin fails

see #4817 (issuecomment-434778055)
3.3.3.1
SomberNight 6 years ago
parent
commit
0862fdb9a9
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/plugin.py

7
electrum/plugin.py

@ -100,8 +100,11 @@ class Plugins(DaemonThread):
if not loader: if not loader:
raise RuntimeError("%s implementation for %s plugin not found" raise RuntimeError("%s implementation for %s plugin not found"
% (self.gui_name, name)) % (self.gui_name, name))
p = loader.load_module() try:
plugin = p.Plugin(self, self.config, name) p = loader.load_module()
plugin = p.Plugin(self, self.config, name)
except Exception as e:
raise Exception(f"Error loading {name} plugin: {e}") from e
self.add_jobs(plugin.thread_jobs()) self.add_jobs(plugin.thread_jobs())
self.plugins[name] = plugin self.plugins[name] = plugin
self.print_error("loaded", name) self.print_error("loaded", name)

Loading…
Cancel
Save