Skip to content

Commit

Permalink
Replacing an error message 415 #2 (#84)
Browse files Browse the repository at this point in the history
* Update handlers.py

* Update handlers.py

* Update handlers.py

* Update handlers.py

* Update handlers.py

* Update handlers.py

* Update handlers.py
  • Loading branch information
iskomir authored Apr 29, 2024
1 parent 78a03fe commit 84fdccc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
Expand Down

0 comments on commit 84fdccc

Please sign in to comment.