diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2016-11-13 21:49:00 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2016-11-13 21:49:00 +0900 |
commit | ec70e9a3ddd674ca4eb33119ec349a1060fcfbcc (patch) | |
tree | 7d7cb4858127559d565a88699a7797ecbd230233 | |
parent | c03919d480f785044a4b2b170dc874d6afe7bb2e (diff) | |
download | buildstream-ec70e9a3ddd674ca4eb33119ec349a1060fcfbcc.tar.gz |
_plugincontext.py: Raise PluginError when plugin fails to provide setup()
-rw-r--r-- | buildstream/_plugincontext.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/_plugincontext.py b/buildstream/_plugincontext.py index 5575ed504..a108c28ac 100644 --- a/buildstream/_plugincontext.py +++ b/buildstream/_plugincontext.py @@ -77,8 +77,12 @@ class _PluginContext(): def load_plugin(self, kind): - plugin = self.source.load_plugin(kind) - plugin_type = plugin.setup() + plugin = self.source.load_plugin(kind) + try: + plugin_type = plugin.setup() + except AttributeError as e: + raise PluginError ("%s plugin '%s' did not provide a setup() method" % + (self.base_type.__name__, kind)) from e self.assert_plugin (kind, plugin_type) |