mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Don't break groups in case one handler raises an unhandled exception
The error is logged instead. Fixes #126
This commit is contained in:
parent
b79bd1ea83
commit
0162cf48c1
@ -90,6 +90,7 @@ class Dispatcher:
|
||||
|
||||
def dispatch(self, update, users: dict = None, chats: dict = None, is_raw: bool = False):
|
||||
for group in self.groups.values():
|
||||
try:
|
||||
for handler in group:
|
||||
if is_raw:
|
||||
if not isinstance(handler, RawUpdateHandler):
|
||||
@ -127,6 +128,8 @@ class Dispatcher:
|
||||
|
||||
handler.callback(*args)
|
||||
break
|
||||
except Exception as e:
|
||||
log.error(e, exc_info=True)
|
||||
|
||||
def update_worker(self):
|
||||
name = threading.current_thread().name
|
||||
|
Loading…
x
Reference in New Issue
Block a user