Skip to content
Snippets Groups Projects
Commit 593e29bc authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

catch errors that could appear when running plugins gui extention points

parent ac5db73d
No related branches found
No related tags found
No related merge requests found
...@@ -255,7 +255,11 @@ class PluginManager(metaclass=Singleton): ...@@ -255,7 +255,11 @@ class PluginManager(metaclass=Singleton):
if gui_extpoint_name in self.gui_extension_points_handlers: if gui_extpoint_name in self.gui_extension_points_handlers:
for handlers in self.gui_extension_points_handlers[ for handlers in self.gui_extension_points_handlers[
gui_extpoint_name]: gui_extpoint_name]:
handlers[0](*args) try:
handlers[0](*args)
except Exception, e:
log.warning('Error executing %s', handlers[0],
exc_info=True)
def _register_events_handlers_in_ged(self, plugin): def _register_events_handlers_in_ged(self, plugin):
for event_name, handler in plugin.events_handlers.items(): for event_name, handler in plugin.events_handlers.items():
...@@ -326,7 +330,11 @@ class PluginManager(metaclass=Singleton): ...@@ -326,7 +330,11 @@ class PluginManager(metaclass=Singleton):
gui_extpoint_name]: gui_extpoint_name]:
handler = gui_extpoint_handlers[1] handler = gui_extpoint_handlers[1]
if handler: if handler:
handler(*gui_extension_point_args) try:
handler(*gui_extension_point_args)
except Exception, e:
log.warning('Error executing %s', handler,
exc_info=True)
self._remove_events_handler_from_ged(plugin) self._remove_events_handler_from_ged(plugin)
self._remove_network_events_from_nec(plugin) self._remove_network_events_from_nec(plugin)
...@@ -357,7 +365,12 @@ class PluginManager(metaclass=Singleton): ...@@ -357,7 +365,12 @@ class PluginManager(metaclass=Singleton):
gui_extpoint_name]: gui_extpoint_name]:
handler = gui_extpoint_handlers[0] handler = gui_extpoint_handlers[0]
if handler: if handler:
handler(*gui_extension_point_args) try:
handler(*gui_extension_point_args)
except Exception, e:
log.warning('Error executing %s', handler,
exc_info=True)
@log_calls('PluginManager') @log_calls('PluginManager')
def _activate_all_plugins(self): def _activate_all_plugins(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment