2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 22:35:36 +00:00

Merge pull request #293 from mendelmaleh/try_handler_check

Try/except handler.check()
This commit is contained in:
Dan
2019-08-01 08:38:47 +02:00
committed by GitHub

View File

@@ -166,8 +166,13 @@ class Dispatcher:
args = None
if isinstance(handler, handler_type):
if handler.check(parsed_update):
args = (parsed_update,)
try:
if handler.check(parsed_update):
args = (parsed_update,)
except Exception as e:
log.error(e, exc_info=True)
continue
elif isinstance(handler, RawUpdateHandler):
args = (update, users, chats)