changeset 476d6876f5fb in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=476d6876f5fb
description: print and ignore exceptions raised in an event handler.
diffstat:
src/common/ged.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r 8491c04c2a1f -r 476d6876f5fb src/common/ged.py
--- a/src/common/ged.py Tue Nov 22 20:08:08 2011 +0100
+++ b/src/common/ged.py Tue Nov 22 22:51:33 2011 +0100
@@ -25,6 +25,8 @@
:license: GPL
'''
+import traceback
+
import logging
log = logging.getLogger('gajim.c.ged')
@@ -85,5 +87,10 @@
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()
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits