plugins: somewhat clearer exception is loading plugin fails

see #4817 (issuecomment-434778055)
This commit is contained in:
SomberNight 2018-10-31 18:33:28 +01:00
parent 386e0d560e
commit 0862fdb9a9
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -100,8 +100,11 @@ class Plugins(DaemonThread):
if not loader:
raise RuntimeError("%s implementation for %s plugin not found"
% (self.gui_name, name))
p = loader.load_module()
plugin = p.Plugin(self, self.config, name)
try:
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.plugins[name] = plugin
self.print_error("loaded", name)