Skip to content

Commit

Permalink
Merge pull request #3 from ashkrishan/master
Browse files Browse the repository at this point in the history
Added exception handling status code 429
  • Loading branch information
kernelmachine committed Nov 24, 2016
2 parents 78a264f + 4262a00 commit 5e83e25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hibp/hibp.py
Expand Up @@ -153,6 +153,8 @@ def execute(self):
return self
elif response.status_code == 404 and self.service == Services.Breach:
raise ValueError("invalid breach name {}.".format(self.param))
elif response.status_code == 429 and self.service == Services.AccountBreach:
raise ValueError("Rate limit error {}.".format(self.param))
else:
self.response = response.json()
return self
Expand Down

0 comments on commit 5e83e25

Please sign in to comment.