Add URL to all URLErrors

This commit is contained in:
Paul Makepeace 2011-04-28 17:13:19 +00:00
parent e771a0ed53
commit 3d5834c522
1 changed files with 3 additions and 6 deletions

View File

@ -47,12 +47,9 @@ class RefineServer(object):
try:
response = urllib2.urlopen(req)
except urllib2.URLError as (url_error,):
if 'Connection refused' in url_error:
raise urllib2.URLError(
'%s for %s. No Refine server reachable/running; ENV set?' %
(url_error, self.server))
else:
raise
raise urllib2.URLError(
'%s for %s. No Refine server reachable/running; ENV set?' %
(url_error, self.server))
if response.info().get('Content-Encoding', None) == 'gzip':
# Need a seekable filestream for gzip
gzip_fp = gzip.GzipFile(fileobj=StringIO.StringIO(response.read()))