Add URL to all URLErrors
This commit is contained in:
parent
e771a0ed53
commit
3d5834c522
|
@ -47,12 +47,9 @@ class RefineServer(object):
|
||||||
try:
|
try:
|
||||||
response = urllib2.urlopen(req)
|
response = urllib2.urlopen(req)
|
||||||
except urllib2.URLError as (url_error,):
|
except urllib2.URLError as (url_error,):
|
||||||
if 'Connection refused' in url_error:
|
|
||||||
raise urllib2.URLError(
|
raise urllib2.URLError(
|
||||||
'%s for %s. No Refine server reachable/running; ENV set?' %
|
'%s for %s. No Refine server reachable/running; ENV set?' %
|
||||||
(url_error, self.server))
|
(url_error, self.server))
|
||||||
else:
|
|
||||||
raise
|
|
||||||
if response.info().get('Content-Encoding', None) == 'gzip':
|
if response.info().get('Content-Encoding', None) == 'gzip':
|
||||||
# Need a seekable filestream for gzip
|
# Need a seekable filestream for gzip
|
||||||
gzip_fp = gzip.GzipFile(fileobj=StringIO.StringIO(response.read()))
|
gzip_fp = gzip.GzipFile(fileobj=StringIO.StringIO(response.read()))
|
||||||
|
|
Loading…
Reference in New Issue