Skip to content

Commit

Permalink
Throw error for bad creds
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaSha committed Mar 22, 2015
1 parent 73119af commit d0d0716
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/kohsuke/github/Requester.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ private InputStream wrapStream(InputStream in) throws IOException {
* 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);
}
Expand Down

0 comments on commit d0d0716

Please sign in to comment.