From fdcb58ba2c0606e3847c52d4b5b63ad2a6082fb8 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 3 Aug 2015 19:29:30 -0700 Subject: [PATCH] Irc: reconnect instead of killing when an error is received --- main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 7709260..304bb8f 100755 --- a/main.py +++ b/main.py @@ -7,7 +7,6 @@ import time import sys from collections import defaultdict import threading -import _thread from log import log import conf @@ -133,10 +132,8 @@ class Irc(): try: hook_args = self.proto.handle_events(self, line) except Exception: - # We broke! Shutdown immediately. - log.exception('(%s) Caught error in handle_events, exiting!', self.name) - _thread.interrupt_main() - sys.exit(4) + log.exception('(%s) Caught error in handle_events, disconnecting!', self.name) + return # Only call our hooks if there's data to process. Handlers that support # hooks will return a dict of parsed arguments, which can be passed on # to plugins and the like. For example, the JOIN handler will return