The HIBP API returns some error responses in certain scenarios. We need to have appropriate exceptions for each of the possible error response. The possible error response codes are documented here: https://haveibeenpwned.com/API/v3#ResponseCodes
Implement an exception for each error response
follow the custom exception best practices
add custom exception properties if there is some data in the error response that we want to capture
Override the ToString method so that we can return a meaningful exception string
Feel free to design the exceptions the way you see fit.
Silviu
The HIBP API returns some error responses in certain scenarios. We need to have appropriate exceptions for each of the possible error response. The possible error response codes are documented here: https://haveibeenpwned.com/API/v3#ResponseCodes