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
Fix secondary rate limits URL #3001
Fix secondary rate limits URL #3001
Conversation
@@ -1259,7 +1259,8 @@ func CheckResponse(r *http.Response) error { | |||
} | |||
case r.StatusCode == http.StatusForbidden && | |||
(strings.HasSuffix(errorResponse.DocumentationURL, "#abuse-rate-limits") || | |||
strings.HasSuffix(errorResponse.DocumentationURL, "#secondary-rate-limits")): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be good to also check for secondary rate limit
in the error message
to be more resilient to future documentation updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, either or should be fine.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3001 +/- ##
=======================================
Coverage 97.93% 97.93%
=======================================
Files 150 150
Lines 12952 12952
=======================================
Hits 12685 12685
Misses 190 190
Partials 77 77 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Letiste !
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Letiste !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you, @liaodaniel ! |
GitHub updated its documentation for rate limits and is now sending the following message when a secondary rate limit is triggered:
This PR updates the check on the
documentation_url
to detect a secondary rate limit