Skip to content

Commit

Permalink
fix return values for checkUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
gereonvey committed Feb 28, 2024
1 parent 73ee148 commit 919c89c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checks-checker
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def checkUrl(url: str) -> tuple:
response = requests.get(url)
except requests.ConnectionError:
errors.append(("e",f"Connection failed for {url}"))
return
return (errors, warnings)
if not response.ok:
errors.append(f"status {response.status_code} returned for {url}")
return
return (errors, warnings)

# If a URL gets redirected, we might want to
# change the documentation link to the redirection target.
Expand All @@ -87,7 +87,7 @@ def checkUrl(url: str) -> tuple:
htmlElements=soup.find_all(name=parts.fragment)
if len(htmlElements)==0:
errors.append(f"fragment \"{parts.fragment}\" not found in {url}")
return 1
return (errors, warnings)

# get the canonical link of the document
canonical_links=soup.select('head link[rel*=canonical]')
Expand Down

0 comments on commit 919c89c

Please sign in to comment.