From 2338377eda0935783510546f73b74c7d7866e0ba Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Sat, 20 Feb 2016 15:20:00 +0200 Subject: [PATCH] request: better parsing of URLError exception --- telegram/utils/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram/utils/request.py b/telegram/utils/request.py index 17b53324c..662f8f45a 100644 --- a/telegram/utils/request.py +++ b/telegram/utils/request.py @@ -94,7 +94,7 @@ def _try_except_req(func): raise NetworkError('{0} ({1})'.format(message, errcode)) except URLError as error: - raise NetworkError('URLError: {0!r}'.format(error)) + raise NetworkError('URLError: {0}'.format(error.reason)) except (SSLError, socket.timeout) as error: err_s = str(error)