Skip to content

Commit

Permalink
Update BrokenPlugin to RF 2.9 error_details method
Browse files Browse the repository at this point in the history
In RF 2.9, Robot Framework's get_error_details method was updated to
return a tuple with message and traceback.
  • Loading branch information
Guillermo Zapata authored and yanne committed Feb 19, 2016
1 parent bf15ae2 commit 3c170cf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/robotide/application/pluginconnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def PluginFactory(application, plugin_class):
try:
plugin = plugin_class(application)
except Exception:
return BrokenPlugin(utils.get_error_details(), plugin_class)
msg, traceback = utils.get_error_details(),
return BrokenPlugin(msg, traceback, plugin_class)
else:
return PluginConnector(plugin, application)

Expand Down Expand Up @@ -63,12 +64,12 @@ def disable(self):

class BrokenPlugin(_PluginConnector):

def __init__(self, error, plugin_class):
def __init__(self, error_msg, traceback, plugin_class):
name = utils.name_from_class(plugin_class, 'Plugin')
doc = 'This plugin is disabled because it failed to load properly.\n' \
+ 'Error: ' + error
_PluginConnector.__init__(self, name, doc=doc, error=error)
LOG.error("Taking %s plugin into use failed:\n%s" % (name, error))
+ 'Error: ' + error_msg + '\n' + traceback
_PluginConnector.__init__(self, name, doc=doc, error=error_msg)
LOG.error("Taking %s plugin into use failed:\n%s" % (name, error_msg))

def enable_on_startup(self):
pass

0 comments on commit 3c170cf

Please sign in to comment.