Visitar URL original
Try/except handler.check() · hexa0code/pyrogram@02451ff · GitHub
Skip to content

Commit 02451ff

Browse files
committed
Try/except handler.check()
Previously, when handler.check raised errors, it would be excepted by the try on line 153, and would fail to loop through the rest of the groups/handlers.
1 parent d875298 commit 02451ff

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎pyrogram/client/ext/dispatcher.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,13 @@ def update_worker(self, lock):
166166
args = None
167167

168168
if isinstance(handler, handler_type):
169-
if handler.check(parsed_update):
170-
args = (parsed_update,)
169+
try:
170+
if handler.check(parsed_update):
171+
args = (parsed_update,)
172+
except Exception as e:
173+
log.error(e, exc_info=True)
174+
continue
175+
171176
elif isinstance(handler, RawUpdateHandler):
172177
args = (update, users, chats)
173178

0 commit comments

Comments
 (0)