Catch httplib.HTTPException as well

Fixes bug 932927

None of the httplib exceptions will get converted into urllib2 exceptions

Change-Id: Iad72821fa1ed54fdb213b371223e94e183dec334
This commit is contained in:
Johannes Erdfelt
2012-02-15 17:38:05 +00:00
parent 4c756df0bd
commit 3a95d451ed

View File

@@ -93,6 +93,10 @@ def _download_tarball(request, staging_path):
raise RetryException(error)
except urllib2.URLError, error:
raise RetryException(error)
except httplib.HTTPException, error:
# httplib.HTTPException and derivatives (BadStatusLine in particular)
# don't have a useful __repr__ or __str__
raise RetryException('%s: %s' % (error.__class__.__name__, error))
tar_cmd = "tar -zx --directory=%(staging_path)s" % locals()
tar_proc = _make_subprocess(tar_cmd, stderr=True, stdin=True)