-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "retry-after" information to abuse detection exceptions #1527
Comments
Hey @SeanKilleen that sounds like a great idea
This option sounds 👍 to me |
@ryangribble sounds good. I'll plan to tackle this in the following way:
|
@ryangribble any preferences on what to do if the For now, will proceed with idea of a default value of 60 seconds. |
Personally im not a fan of a non official default that we make up ourselves. I think make it nullable and if the value can't be parsed/isn't present then return |
Sure thing -- I'll make those adjustments. |
Also, I added the failing test back. Normally my preference would have been to open a new PR against #1529 but this works fine too. |
Offering a suggestion that I'm willing to look at implementing as well.
I was having a little too much fun exploring Github with some concurrent actor processes and tripped the abuse mechanism. I received a
ForbiddenException
with the reason and pointing me to Github's Abuse Rate Limits Guide.There, I see that a header exists for
Retry-After
-- an integer representing the number of seconds to wait. Would be awesome to be able to retrieve this information so that I could respect it in the event that an abuse-style exception is triggered.Current way
I think I could currently achieve this, catching the
ForbiddenException
, and then getting the headers directly from theIResponse
passed in as part of theHttpResponse
field. Is that correct?A better way?
Would it make sense to inherit this exception type from Forbidden exception and supply the
Retry-After
value directly in the Exception?Please let me know if there's interest in this. Thanks!
The text was updated successfully, but these errors were encountered: