icanhasfay / PyPwned

A Python client for the HaveIBeenPwned REST API
MIT License
45 stars 12 forks source link

getAllBreachesForAccount() fails with JSONDecodeError on 524 error responses #4

Closed RevolutionTech closed 7 years ago

RevolutionTech commented 7 years ago

Very similar to https://github.com/icanhasfay/PyPwned/issues/2.

Occasionally, haveibeenpwned.com returns 524 status codes which are not handled by the client, so this results in a JSONDecodeError. It might be a good idea to handle any 5xx status codes the same way, something like "An error occurred on haveibeenpwned.com. Please try again later."

RevolutionTech commented 7 years ago

The PR for this issue was merged in. Thanks!