From b7eb32a73cb171da444bdff0aea27a9f6dcd3bca Mon Sep 17 00:00:00 2001
From: Jamie Lennox <jamielennox@gmail.com>
Date: Sat, 16 Apr 2011 15:39:40 +1000
Subject: [PATCH] Stop an exception in an Event handler from preventing further emissions
---
deluge/core/eventmanager.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/deluge/core/eventmanager.py b/deluge/core/eventmanager.py
index 1985070..a1b6342 100644
a
|
b
|
def emit(self, event):
|
55 | 55 | if event.name in self.handlers: |
56 | 56 | for handler in self.handlers[event.name]: |
57 | 57 | #log.debug("Running handler %s for event %s with args: %s", event.name, handler, event.args) |
58 | | handler(*event.args) |
| 58 | try: |
| 59 | handler(*event.args) |
| 60 | except: |
| 61 | log.exception("Event handler %s failed in %s", event.name, handler) |
59 | 62 | |
60 | 63 | def register_event_handler(self, event, handler): |
61 | 64 | """ |