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

Message text in RateLimitExceededException is needlessly complex #63

Closed akamsteeg closed 2 years ago

akamsteeg commented 2 years ago

See https://github.com/akamsteeg/AtleX.HaveIBeenPwned/blob/6ea777b892fcc05ae15c83febc1b2ad1b9996349/src/AtleX.HaveIBeenPwned/RateLimitExceededException.cs#L24

The message currently contains the time to retry after. But that's information the user doesn't need. It contains information about when to retry after the exception was thrown, but that's of little value if the message ends up in a log. And when it's directly displayed to the user, which should never happen preferably, it also doesn't contain enough information about the exact cause of the error and what they should do. But in the meantime, we spent a significant amount of resources formatting that message string.

So, we should just simplify it to a hardcoded "HaveIBeenPwned.com rate limit exceeded" or something like that. Makes the code in the library simpler, improves the performance and doesn't change anything for consumers.