Add PhotoAsInputFileRequired exception. // Photo should be uploaded as an InputFile

This commit is contained in:
Alex Root Junior 2018-04-08 17:31:58 +03:00
parent b808c48789
commit f0de1c5761
2 changed files with 6 additions and 0 deletions

View file

@ -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):

View file

@ -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