Skip to content

Commit 41ba57f

Browse files
committed
don't stop the dispatcher thread on uncaught errors
1 parent b205751 commit 41ba57f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

telegram/dispatcher.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from inspect import getargspec
2626
from threading import Thread, BoundedSemaphore, Lock
2727
from re import match
28+
from traceback import print_exc
2829

2930
from telegram import (TelegramError, Update, NullHandler)
3031

@@ -180,6 +181,10 @@ def start(self):
180181
self.logger.warn("Error was raised while processing Update.")
181182
self.dispatchError(update, te)
182183

184+
# All other errors should not stop the thread, so just print them
185+
except:
186+
print_exc()
187+
183188
self.logger.info('Dispatcher thread stopped')
184189

185190
def stop(self):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy