diff --git a/snapshotter/src/snapshot.py b/snapshotter/src/snapshot.py index 77de810..2a92214 100644 --- a/snapshotter/src/snapshot.py +++ b/snapshotter/src/snapshot.py @@ -29,6 +29,8 @@ def today(today=dt.today()): def download(url, target, **kwargs): response = requests.get(url, stream=True, **kwargs) + if not response.ok: + raise ValueError("HTTP not OK", response.status_code, response.text) response.raw.decode_content = True with open(target, "wb") as out: shutil.copyfileobj(response.raw, out)