Commit 7306a5c6 authored by Rémi Duraffort's avatar Rémi Duraffort

download: record the http error code when failing

This help to understand why the resource is not accessible.

Change-Id: Ib98447f9432282c8a5dfa4f2b56ba337f555ad26
parent abb9869f
......@@ -455,7 +455,7 @@ class HttpDownloadAction(DownloadHandler):
res = requests.get(
self.url.geturl(), allow_redirects=True, stream=True)
if res.status_code != requests.codes.OK: # pylint: disable=no-member
self.errors = "Resources not available at '%s'" % (self.url.geturl())
self.errors = "Resource unavailable at '%s' (%d)" % (self.url.geturl(), res.status_code)
self.size = int(res.headers.get('content-length', -1))
except requests.Timeout:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment