However, that forces a user to implement an exception handler and write additional code to handle the exception. And what most likely will happen is that in the catch of the try..catch the request will be retried anyway. So, to make life easier we should just default to 0 when the specified retry-after is less than 0.
Currently, when the value of
retryAfter
inRateLimitExceededException
is less than 0 anArgumentOutOfRangeException
is thrown.https://github.com/akamsteeg/AtleX.HaveIBeenPwned/blob/d23072b9aa1de60a6d60b9a334f3ca07d8625dfb/src/AtleX.HaveIBeenPwned/RateLimitExceededException.cs#L30
However, that forces a user to implement an exception handler and write additional code to handle the exception. And what most likely will happen is that in the
catch
of thetry..catch
the request will be retried anyway. So, to make life easier we should just default to 0 when the specified retry-after is less than 0.