akamsteeg / AtleX.HaveIBeenPwned

A fully async .NET Standard client library for the API of HaveIBeenPwned.com
https://www.nuget.org/packages/AtleX.HaveIBeenPwned/
MIT License
5 stars 0 forks source link

Improve resilience and error handling of retrieving pastes for an account #82

Closed akamsteeg closed 1 year ago

akamsteeg commented 1 year ago

When getting the pastes for an unknown account, the 404s and empty responses are not correctly handled. This leads to confusing exceptions about failed JSON deserialization etc.

Solution approach: Correctly handle 404s and empty responses and return an empty collection in that case.

akamsteeg commented 1 year ago

Unfortunately the fix is a breaking change because we now return an empty collection again instead of throwing an exception.