Skip to content

Commit

Permalink
Handle downloading github raw files gracefully for 403 status code (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
amoghrajesh authored Dec 2, 2024
1 parent 3413b12 commit 1e0a499
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ def download_file_from_github(tag: str, path: str, output_file: Path, timeout: i
if not get_dry_run():
try:
response = requests.get(url, timeout=timeout)
if response.status_code == 403:
get_console().print(
f"[error]The {url} is not accessible.This may be caused by either of:\n"
f" 1. network issues or VPN settings\n"
f" 2. Github rate limit"
)
return False
if response.status_code == 404:
get_console().print(f"[warning]The {url} has not been found. Skipping")
return False
Expand Down

0 comments on commit 1e0a499

Please sign in to comment.