From 3c8172cdf8473c3cb53520e216578ef25a7b610f Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 8 Nov 2011 21:00:35 +0100 Subject: [PATCH] Catch the event if it isn't caught inside itself. --- couchpotato/core/event.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/event.py b/couchpotato/core/event.py index 53ef7637..edab2139 100644 --- a/couchpotato/core/event.py +++ b/couchpotato/core/event.py @@ -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)