request: better parsing of URLError exception

This commit is contained in:
Noam Meltzer 2016-02-20 15:20:00 +02:00
parent 04c86813b3
commit 2338377eda

View file

@ -94,7 +94,7 @@ def _try_except_req(func):
raise NetworkError('{0} ({1})'.format(message, errcode)) raise NetworkError('{0} ({1})'.format(message, errcode))
except URLError as error: except URLError as error:
raise NetworkError('URLError: {0!r}'.format(error)) raise NetworkError('URLError: {0}'.format(error.reason))
except (SSLError, socket.timeout) as error: except (SSLError, socket.timeout) as error:
err_s = str(error) err_s = str(error)