From 05376e04fd8436936c52b1bc3ae1bc24444ea155 Mon Sep 17 00:00:00 2001 From: Kostiantyn Kriuchkov <36363097+Latand@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:53:50 +0300 Subject: [PATCH] Update error_handler.py --- handlers/errors/error_handler.py | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/handlers/errors/error_handler.py b/handlers/errors/error_handler.py index 3f6307e..2cb12a8 100644 --- a/handlers/errors/error_handler.py +++ b/handlers/errors/error_handler.py @@ -18,42 +18,14 @@ async def errors_handler(update, exception): :return: stdout logging """ - if isinstance(exception, CantDemoteChatCreator): - logging.exception("Can't demote chat creator") - # do something here? - return True if isinstance(exception, MessageNotModified): logging.exception('Message is not modified') - # or here - return True - if isinstance(exception, MessageCantBeDeleted): - logging.exception('Message cant be deleted') - # or here - return True - - if isinstance(exception, MessageToDeleteNotFound): - logging.exception('Message to delete not found') - # well, you know. - return True - - if isinstance(exception, MessageTextIsEmpty): - logging.exception('MessageTextIsEmpty') - return True - - if isinstance(exception, Unauthorized): - logging.exception(f'Unauthorized: {exception}') - return True - - if isinstance(exception, InvalidQueryID): - logging.exception(f'InvalidQueryID: {exception} \nUpdate: {update}') - return True - - if isinstance(exception, RetryAfter): - logging.exception(f'RetryAfter: {exception} \nUpdate: {update}') + # do something here? return True if isinstance(exception, CantParseEntities): + # or here logging.exception(f'CantParseEntities: {exception} \nUpdate: {update}') return True