Commit f3a27e66 by Guba Sándor

disk: wrong status codes raise exceptions

parent cde8c7b2
......@@ -138,7 +138,9 @@ class Disk(object):
disk_path = self.get_path()
logger.info("Downloading image from %s to %s", url, disk_path)
r = requests.get(url, stream=True)
if r.status_code == 200:
if r.status_code != 200:
raise Exception("Invalid response status code: %s" % r.status_code)
class AbortException(Exception):
pass
if task.is_aborted():
......
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 sign in to comment