mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-04 08:21:23 +00:00
Throw error for bad creds
This commit is contained in:
@@ -479,6 +479,9 @@ class Requester {
|
||||
* Handle API error by either throwing it or by returning normally to retry.
|
||||
*/
|
||||
/*package*/ void handleApiError(IOException e) throws IOException {
|
||||
if (uc.getResponseCode() == 401) // Unauthorized == bad creds
|
||||
throw e;
|
||||
|
||||
if ("0".equals(uc.getHeaderField("X-RateLimit-Remaining"))) {
|
||||
root.rateLimitHandler.onError(e,uc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user