mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-14 02:52:12 +00:00
Added new error types: PhotoDimensions, UnavailableMembers
This commit is contained in:
parent
7df5337cb4
commit
0b48978bd3
2 changed files with 22 additions and 0 deletions
|
|
@ -100,6 +100,12 @@ async def _check_result(method_name, response):
|
||||||
exceptions.InvalidStickersSet.throw()
|
exceptions.InvalidStickersSet.throw()
|
||||||
elif exceptions.ChatAdminRequired.check(description):
|
elif exceptions.ChatAdminRequired.check(description):
|
||||||
exceptions.ChatAdminRequired.throw()
|
exceptions.ChatAdminRequired.throw()
|
||||||
|
elif exceptions.PhotoDimensions.check(description):
|
||||||
|
exceptions.PhotoDimensions.throw()
|
||||||
|
elif exceptions.UnavailableMembers.check(description):
|
||||||
|
exceptions.UnavailableMembers.throw()
|
||||||
|
elif exceptions.TypeOfFileMismatch.check(description):
|
||||||
|
exceptions.TypeOfFileMismatch.throw()
|
||||||
raise exceptions.BadRequest(description)
|
raise exceptions.BadRequest(description)
|
||||||
elif response.status == HTTPStatus.NOT_FOUND:
|
elif response.status == HTTPStatus.NOT_FOUND:
|
||||||
if exceptions.MethodNotKnown.check(description):
|
if exceptions.MethodNotKnown.check(description):
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ TelegramAPIError
|
||||||
ToMuchMessages
|
ToMuchMessages
|
||||||
InvalidStickersSet
|
InvalidStickersSet
|
||||||
ChatAdminRequired
|
ChatAdminRequired
|
||||||
|
PhotoDimensions
|
||||||
|
UnavailableMembers
|
||||||
|
TypeOfFileMismatch
|
||||||
ConflictError
|
ConflictError
|
||||||
TerminatedByOtherGetUpdates
|
TerminatedByOtherGetUpdates
|
||||||
CantGetUpdates
|
CantGetUpdates
|
||||||
|
|
@ -168,6 +171,19 @@ class ChatAdminRequired(BadRequest, _MatchErrorMixin):
|
||||||
text = 'Admin permissions is required!'
|
text = 'Admin permissions is required!'
|
||||||
|
|
||||||
|
|
||||||
|
class PhotoDimensions(BadRequest, _MatchErrorMixin):
|
||||||
|
match = 'PHOTO_INVALID_DIMENSIONS'
|
||||||
|
text = 'Invalid photo dimensions'
|
||||||
|
|
||||||
|
|
||||||
|
class UnavailableMembers(BadRequest, _MatchErrorMixin):
|
||||||
|
match = 'supergroup members are unavailable'
|
||||||
|
|
||||||
|
|
||||||
|
class TypeOfFileMismatch(BadRequest, _MatchErrorMixin):
|
||||||
|
match = 'type of file mismatch'
|
||||||
|
|
||||||
|
|
||||||
class BadWebhook(BadRequest):
|
class BadWebhook(BadRequest):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue