Skip to content

Commit

Permalink
Properly error out if fetching fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruechert committed Mar 1, 2024
1 parent 07abd59 commit 6b32a7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def fetch_source(self, name: str, source: Source) -> Optional[Path]:

# If the file was not successfully retrieved, return
if response.status_code != 200:
return None
print("Error: Could not fetch file:")
print("Status Code:", response.status_code,
"Body:", response.content)
sys.exit(1)

download_dir = "downloads"

Expand Down

0 comments on commit 6b32a7e

Please sign in to comment.