Skip to content

Commit

Permalink
treat error code 404 properly
Browse files Browse the repository at this point in the history
  • Loading branch information
security-companion committed Apr 4, 2024
1 parent 62e3d3b commit 197490e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hibp_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def make_request(config, url):
if response.status_code == 401:
print("API key not valid")
sys.exit(1)
elif response.status_code == 404:
print("the account could not be found and has therefore not been pwned")
print(url)
return {}
else:
print(f"response code: {response.status_code}")
print(f"response message: {response.message}")
Expand Down

0 comments on commit 197490e

Please sign in to comment.