Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit aad20d0

Browse files
committed
Merge pull request hub4j#169 from KostyaSha/fixAuthLoop
Throw error for bad creds
2 parents 7ff9734 + d0d0716 commit aad20d0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/kohsuke/github/Requester.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ private InputStream wrapStream(InputStream in) throws IOException {
479479
* Handle API error by either throwing it or by returning normally to retry.
480480
*/
481481
/*package*/ void handleApiError(IOException e) throws IOException {
482+
if (uc.getResponseCode() == 401) // Unauthorized == bad creds
483+
throw e;
484+
482485
if ("0".equals(uc.getHeaderField("X-RateLimit-Remaining"))) {
483486
root.rateLimitHandler.onError(e,uc);
484487
}

0 commit comments

Comments
 (0)