Wow. Fail. Wrong method name.

This commit is contained in:
Alex Root Junior 2018-04-09 00:30:38 +03:00
parent 15c85c53db
commit ca3aa504cf

View file

@ -99,17 +99,17 @@ async def _check_result(method_name, response):
exceptions.MethodNotKnown.throw() exceptions.MethodNotKnown.throw()
raise exceptions.NotFound(description) raise exceptions.NotFound(description)
elif response.status == HTTPStatus.CONFLICT: elif response.status == HTTPStatus.CONFLICT:
if exceptions.TerminatedByOtherGetUpdates.match(description): if exceptions.TerminatedByOtherGetUpdates.check(description):
exceptions.TerminatedByOtherGetUpdates.throw() exceptions.TerminatedByOtherGetUpdates.throw()
if exceptions.CantGetUpdates.match(description): if exceptions.CantGetUpdates.check(description):
exceptions.CantGetUpdates.throw() exceptions.CantGetUpdates.throw()
raise exceptions.ConflictError(description) raise exceptions.ConflictError(description)
elif response.status in [HTTPStatus.UNAUTHORIZED, HTTPStatus.FORBIDDEN]: elif response.status in [HTTPStatus.UNAUTHORIZED, HTTPStatus.FORBIDDEN]:
if exceptions.BotKicked.match(description): if exceptions.BotKicked.check(description):
exceptions.BotKicked.throw() exceptions.BotKicked.throw()
elif exceptions.BotBlocked.match(description): elif exceptions.BotBlocked.check(description):
exceptions.BotBlocked.throw() exceptions.BotBlocked.throw()
elif exceptions.UserDeactivated.match(description): elif exceptions.UserDeactivated.check(description):
exceptions.UserDeactivated.throw() exceptions.UserDeactivated.throw()
raise exceptions.Unauthorized(description) raise exceptions.Unauthorized(description)
elif response.status == HTTPStatus.REQUEST_ENTITY_TOO_LARGE: elif response.status == HTTPStatus.REQUEST_ENTITY_TOO_LARGE: