Catch the event if it isn't caught inside itself.

This commit is contained in:
Ruud
2011-11-08 21:00:35 +01:00
parent 600757e43b
commit 3c8172cdf8
+4 -1
View File
@@ -20,7 +20,10 @@ def addEvent(name, handler, priority = 0):
try:
parent = handler.im_self
parent.beforeCall(handler)
h = handler(*args, **kwargs)
try:
h = handler(*args, **kwargs)
except:
log.error('Error in event %s, that wasn\'nt caught: %s' % (name, traceback.format_exc()))
parent.afterCall(handler)
except:
h = handler(*args, **kwargs)