utils.request: provide HTTP error code with unknown errors

This commit is contained in:
Noam Meltzer 2015-12-26 01:11:02 +02:00
parent 17dae68654
commit bc2679f2ae

View file

@ -73,7 +73,7 @@ def _try_except_req(func):
try:
message = _parse(error.read())
except ValueError:
message = 'Unknown HTTPError'
message = 'Unknown HTTPError {0}'.format(error.getcode())
raise TelegramError(message)
except (SSLError, socket.timeout) as error: