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

print and ignore exceptions raised in an event handler.

parent 6c605cad
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ Global Events Dispatcher module.
:license: GPL
'''
import traceback
import logging
log = logging.getLogger('gajim.c.ged')
......@@ -85,5 +87,10 @@ class GlobalEventsDispatcher(object):
log.debug('%s\nArgs: %s'%(event_name, str(args)))
if event_name in self.handlers:
for priority, handler in self.handlers[event_name]:
if handler(*args, **kwargs):
return True
try:
if handler(*args, **kwargs):
return True
except Exception, e:
log.error('Error while running an even handler: %s' % \
handler)
traceback.print_exc()
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