mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +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):
|
def dispatch(self, update, users: dict = None, chats: dict = None, is_raw: bool = False):
|
||||||
for group in self.groups.values():
|
for group in self.groups.values():
|
||||||
|
try:
|
||||||
for handler in group:
|
for handler in group:
|
||||||
if is_raw:
|
if is_raw:
|
||||||
if not isinstance(handler, RawUpdateHandler):
|
if not isinstance(handler, RawUpdateHandler):
|
||||||
@ -127,6 +128,8 @@ class Dispatcher:
|
|||||||
|
|
||||||
handler.callback(*args)
|
handler.callback(*args)
|
||||||
break
|
break
|
||||||
|
except Exception as e:
|
||||||
|
log.error(e, exc_info=True)
|
||||||
|
|
||||||
def update_worker(self):
|
def update_worker(self):
|
||||||
name = threading.current_thread().name
|
name = threading.current_thread().name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user