Skip to content

Commit

Permalink
tools: Print failure details
Browse files Browse the repository at this point in the history
This might tell us what's wrong about that dmtf.org URL when running in
GitHub (issue #20167).
  • Loading branch information
martinpitt committed Mar 13, 2024
1 parent 0be8662 commit 0c69347
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/urls-check
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def check_urls(verbose):
if resp.geturl() != url and not any(fnmatch.fnmatch(url, pattern) for pattern in KNOWN_REDIRECTS):
redirects.append(url)
if resp.getcode() >= 400:
failed.append(url)
except urllib.error.URLError:
failed.append(url)
failed.append(f"{url} : {resp.getcode()} {resp.reason}")
except urllib.error.URLError as e:
failed.append(f"{url} : {e.code} {e.reason}")

err = ""
success = ""
Expand Down

0 comments on commit 0c69347

Please sign in to comment.