except the correct exception URLError when downloading.

`urllib.request.open` can raise a URLError or a HTTPError.
This commit is contained in:
Matthieu Gautier 2018-04-17 17:39:13 +02:00
parent 24c771aaa8
commit 72d9e99bf9
1 changed files with 2 additions and 2 deletions

View File

@ -118,8 +118,8 @@ def download_remote(what, where, check_certificate=True):
print_progress(progress_chars[current])
current = (current+1)%4
file.write(batch)
except urllib.error.HTTPError:
print("Cannot download url {}".format(file_url))
except urllib.error.URLError as e:
print("Cannot download url {}:\n{}".format(file_url, e.reason))
raise StopBuild()
if not what.sha256: