Handles HTTP Bad Gateway error (503) on request module #63

This commit is contained in:
Leandro Toledo 2015-09-24 09:17:50 -03:00
parent 797a3e6ea4
commit 6c9490f2c6

View file

@ -94,6 +94,8 @@ def post(url,
except HTTPError as error:
if error.getcode() == 403:
raise TelegramError('Unauthorized')
if error.getcode() == 502:
raise TelegramError('Bad Gateway')
message = _parse(error.read())
raise TelegramError(message)