From 84fdccca831af085942d25216ee908f3988b1c24 Mon Sep 17 00:00:00 2001 From: iskomir <151797312+iskomir@users.noreply.github.com> Date: Mon, 29 Apr 2024 21:24:09 +0300 Subject: [PATCH] Replacing an error message 415 #2 (#84) * Update handlers.py * Update handlers.py * Update handlers.py * Update handlers.py * Update handlers.py * Update handlers.py * Update handlers.py --- src/handlers.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/handlers.py b/src/handlers.py index e94351b..b44c7a5 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -151,6 +151,14 @@ async def handler_print(update: Update, context: ContextTypes.DEFAULT_TYPE): number=requisites[2], ) return + elif rfile.status_code == 415: + await update.message.reply_text( + text=ans.unreadable_file_error.format(update.message.document.file_name), + reply_to_message_id=update.message.id, + parse_mode=ParseMode('HTML'), + ) + logging.warning(f'{log_actor(update)} print api 415 UnreadableErr') + return elif r.status_code == 413: await update.message.reply_text( @@ -161,14 +169,6 @@ async def handler_print(update: Update, context: ContextTypes.DEFAULT_TYPE): logging.warning(f'{log_actor(update)} print api 413 SizeErr') return - elif r.status_code == 415: - await update.message.reply_text( - text=ans.unreadable_file_error.format(update.message.document.file_name), - reply_to_message_id=update.message.id, - parse_mode=ParseMode('HTML'), - ) - logging.warning(f'{log_actor(update)} print api 415 UnreadableErr') - return await context.bot.send_message( chat_id=update.effective_user.id, text=ans.print_err,