Raise error instead of returning None
@@ -116,9 +116,8 @@ def download(url,
stream=True)
if response.status_code != 200:
- logger.error("Failed to download file from %s: %s" % (url, response.status_code),
- extra={'stack': True})
- return None
+ raise ValueError(
+ "Could not get code to build the image, response code %s." % response.status_code)
with open(filename, 'wb') as f:
logger.info("Processing file %s" % filename)
