From 593e29bcd13044a5b59b6e84a2f5366d7868b0f9 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 9 Mar 2014 10:19:24 +0100 Subject: [PATCH] catch errors that could appear when running plugins gui extention points --- src/plugins/pluginmanager.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/plugins/pluginmanager.py b/src/plugins/pluginmanager.py index bcad829ff..5602f5221 100644 --- a/src/plugins/pluginmanager.py +++ b/src/plugins/pluginmanager.py @@ -255,7 +255,11 @@ class PluginManager(metaclass=Singleton): if gui_extpoint_name in self.gui_extension_points_handlers: for handlers in self.gui_extension_points_handlers[ 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): for event_name, handler in plugin.events_handlers.items(): @@ -326,7 +330,11 @@ class PluginManager(metaclass=Singleton): gui_extpoint_name]: handler = gui_extpoint_handlers[1] 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_network_events_from_nec(plugin) @@ -357,7 +365,12 @@ class PluginManager(metaclass=Singleton): gui_extpoint_name]: handler = gui_extpoint_handlers[0] 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') def _activate_all_plugins(self):