-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better messaging on 401 and 403 errors from GitHub
401 errors are caused when the OTP expires from a long session. The way the code is currently organized, it isn't easy to re-ask for it, so for now we just print a message to try again. This generally only happens if the user does something in the middle of running doctr configure, such as going to enable Travis on the repo. If everything is already configured, a single session is generally short enough to use the same OTP code. 403 errors occur when the GitHub API rate limit is hit. This can happen when unauthenticated requests are used (i.e., --no-upload-key), as the limit is 60 global GitHub API requests per IP per hour. For authenticated requests, the limit is 5000 requests per hour, but this is shared across all oauth applications. It seems that the Travis "sync account" button consistently causes this limit to be hit if you have access to many repos (for instance, if you are a member of the conda-forge organization). So if a user goes to enable a repo on Travis, then runs doctr configure, they will hit this error. doctr configure now prints an error message indicating that the rate limit has been hit and how long it will be until it resets. Unfortunately, there is not much else we can do here. Fixes #311.
- Loading branch information
Showing
2 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters