Skip to content

Commit

Permalink
don't stop the dispatcher thread on uncaught errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jh0ker committed Dec 29, 2015
1 parent b205751 commit 41ba57f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions telegram/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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)

Expand Down Expand Up @@ -180,6 +181,10 @@ def start(self):
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):
Expand Down

0 comments on commit 41ba57f

Please sign in to comment.