Skip to content

Commit

Permalink
throwing an exception with there is a failure in http_client.init
Browse files Browse the repository at this point in the history
  • Loading branch information
jhjaggars committed Jan 28, 2025
1 parent 3e90238 commit 6a8da44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ramalama/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def download_file(url, dest_path, headers=None, show_progress=True):
show_progress = False

try:
http_client.init(url=url, headers=headers, output_file=dest_path, progress=show_progress)
rc = http_client.init(url=url, headers=headers, output_file=dest_path, progress=show_progress)
if rc:
raise Exception(f"Failed to download {url}.")
except urllib.error.HTTPError as e:
if e.code == 416: # Range not satisfiable
if show_progress:
Expand Down

0 comments on commit 6a8da44

Please sign in to comment.