don't stop the dispatcher thread on uncaught errors

This commit is contained in:
Jannes Höke 2015-12-29 14:27:46 +01:00
parent b205751aee
commit 41ba57f064

View file

@ -25,6 +25,7 @@ from functools import wraps
from inspect import getargspec
from threading import Thread, BoundedSemaphore, Lock
from re import match
from traceback import print_exc
from telegram import (TelegramError, Update, NullHandler)
@ -180,6 +181,10 @@ class Dispatcher:
self.logger.warn("Error was raised while processing Update.")
self.dispatchError(update, te)
# All other errors should not stop the thread, so just print them
except:
print_exc()
self.logger.info('Dispatcher thread stopped')
def stop(self):