mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-23 15:50:48 +00:00
Better type safety by splitting RateLimitHandler and AbuseLimitHandler
While the signature is the same, headers that they expect are different, so any non-trivial logic cannot be reused.
This commit is contained in:
@@ -572,10 +572,9 @@ class Requester {
|
||||
root.rateLimitHandler.onError(e,uc);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check to see whether we hit a 403, and the Retry-After field is
|
||||
// available.
|
||||
if (responseCode == HttpURLConnection.HTTP_FORBIDDEN &&
|
||||
|
||||
// Retry-After is not documented but apparently that field exists
|
||||
if (responseCode == HttpURLConnection.HTTP_FORBIDDEN &&
|
||||
uc.getHeaderField("Retry-After") != null) {
|
||||
this.root.abuseLimitHandler.onError(e,uc);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user