Skip to content

Commit

Permalink
Fail on all HTTP error codes in check_url
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Oct 23, 2023
1 parent 0005145 commit 427020a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions zimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ def check_url(url, scope=None):
resp = requests.head(
url.geturl(), stream=True, allow_redirects=True, timeout=(12.2, 27)
)
resp.raise_for_status()
except requests.exceptions.RequestException as exc:
print(f"failed to connect to {url.geturl()}: {exc}", flush=True)
raise SystemExit(1)
Expand Down

0 comments on commit 427020a

Please sign in to comment.