# HG changeset patch # User Charly COSTE # Date 1263752408 -3600 # Node ID 0aa31a2b9316cea36b12c1fb1398445fb0ef0317 # Parent 229a59acde0f26fb85f60055ae8b2b61a1a1d91a moved exception handling in IRC thread from process_data() to process_forever() where it belongs Signed-off-by: Charly COSTE diff --git a/irclib.py b/irclib.py --- a/irclib.py +++ b/irclib.py @@ -207,12 +207,7 @@ class IRC: if s == c._get_socket(): c.lock.acquire() if hasattr(c, 'socket'): - try: - c.process_data() - except ServerNotConnectedError: - self.bot.restart() - except: - self.bot.error('[Error] Unkonwn exception on IRC thread:\n'+traceback.format_exc(), send_to_admins=True) + c.process_data() c.lock.release() def process_timeout(self): @@ -259,7 +254,12 @@ class IRC: timeout -- Parameter to pass to process_once. """ while 1: - self.process_once(timeout) + try: + self.process_once(timeout) + except ServerNotConnectedError: + self.bot.restart() + except: + self.bot.error('[Error] Unkonwn exception on IRC thread:\n'+traceback.format_exc(), send_to_admins=True) def disconnect_all(self, message=""): """Disconnects all connections."""