tools: Print failure details

This might tell us what's wrong about that dmtf.org URL when running in
GitHub (issue #20167).
This commit is contained in:
Martin Pitt 2024-03-13 15:49:00 +01:00 committed by Martin Pitt
parent 0be8662240
commit 0c69347fb1
1 changed files with 3 additions and 3 deletions

View File

@ -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 = ""