File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ python3 - "$FORMULA_PATH" "$VERSION" "$SHA256" "$TARBALL_URL" <<'PY'
106106import hashlib
107107import sys
108108import urllib.request
109+ import urllib.error
109110import pathlib
110111
111112formula_path = pathlib.Path(sys.argv[1])
@@ -130,8 +131,16 @@ if old_version is None:
130131 raise SystemExit("could not locate version line in formula")
131132
132133def download_sha(url):
133- with urllib.request.urlopen(url) as resp:
134- data = resp.read()
134+ try:
135+ with urllib.request.urlopen(url) as resp:
136+ data = resp.read()
137+ except urllib.error.HTTPError as exc:
138+ raise SystemExit(
139+ f"failed to download {url} ({exc.code} {exc.reason}). "
140+ "The release asset may not be available yet; wait for the release workflow to finish."
141+ )
142+ except urllib.error.URLError as exc:
143+ raise SystemExit(f"failed to download {url}: {exc.reason}")
135144 return hashlib.sha256(data).hexdigest()
136145
137146sha_cache = {source_url: source_sha}
You can’t perform that action at this time.
0 commit comments