Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 386acca

Browse files
committed
Merge pull request python-telegram-bot#74 from leandrotoledo/http_bad_gateway_as_except
Handles HTTP Bad Gateway error (503) on request module python-telegram-bot#63
2 parents e7686db + 6c9490f commit 386acca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

telegram/utils/request.py

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def post(url,
9494
except HTTPError as error:
9595
if error.getcode() == 403:
9696
raise TelegramError('Unauthorized')
97+
if error.getcode() == 502:
98+
raise TelegramError('Bad Gateway')
9799

98100
message = _parse(error.read())
99101
raise TelegramError(message)

0 commit comments

Comments
 (0)