mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
New error types.
This commit is contained in:
parent
1f8b2b464e
commit
3076173384
2 changed files with 14 additions and 0 deletions
|
|
@ -79,6 +79,8 @@ async def _check_result(method_name, response):
|
|||
raise exceptions.NetworkError('File too large for uploading. '
|
||||
'Check telegram api limits https://core.telegram.org/bots/api#senddocument')
|
||||
elif response.status >= HTTPStatus.INTERNAL_SERVER_ERROR:
|
||||
if 'restart' in description:
|
||||
raise exceptions.RestartingTelegram()
|
||||
raise exceptions.TelegramAPIError(description)
|
||||
raise exceptions.TelegramAPIError(f"{description} [{response.status}]")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue