Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
Import exception logging when dealing with plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmc committed Aug 22, 2014
1 parent 9601132 commit a200f5f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions agamemnon/delegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ def load_plugins(self,plugin_dict):
plugin = cls(**config['plugin_config'])
self.__dict__[key]=plugin
self.plugins.append(key)
except Exception as e:
# Catch all exceptions because we can't know what the plugins will throw.
message = "Can't load plugin {0}. Stack trace:\n{1}".format(key, str(e))
log.error(message)
except Exception:
# TODO: Don't catch all exceptions.
log.exception("Can't load plugin: %s", key)

def on_create(self,node):
for plugin in self.plugins:
Expand All @@ -44,5 +43,5 @@ def __getattr__(self, item):
return attr
except AttributeError:
pass
raise AttributeError("No plugin has attribute: %s" % item)
raise AttributeError("No plugin has attribute: %s", item)

0 comments on commit a200f5f

Please sign in to comment.