mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Add PhotoAsInputFileRequired exception. // Photo should be uploaded as an InputFile
This commit is contained in:
parent
b808c48789
commit
f0de1c5761
2 changed files with 6 additions and 0 deletions
|
|
@ -91,6 +91,8 @@ async def _check_result(method_name, response):
|
||||||
exceptions.BadWebhookPort.throw()
|
exceptions.BadWebhookPort.throw()
|
||||||
elif exceptions.CantParseUrl.check(description):
|
elif exceptions.CantParseUrl.check(description):
|
||||||
exceptions.CantParseUrl.throw()
|
exceptions.CantParseUrl.throw()
|
||||||
|
elif exceptions.PhotoAsInputFileRequired.check(description):
|
||||||
|
exceptions.PhotoAsInputFileRequired.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):
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,10 @@ class GroupDeactivated(BadRequest, _MatchErrorMixin):
|
||||||
match = 'group is deactivated'
|
match = 'group is deactivated'
|
||||||
|
|
||||||
|
|
||||||
|
class PhotoAsInputFileRequired(BadRequest, _MatchErrorMixin):
|
||||||
|
match = 'Photo should be uploaded as an InputFile'
|
||||||
|
|
||||||
|
|
||||||
class BadWebhook(BadRequest):
|
class BadWebhook(BadRequest):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue