Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upError callback not firing when hitting rate limit #348
Comments
|
No preference here. I think I've seen a similar error crop up in the Travis testing. I'm guessing the error actually lies with |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


I'm using github-api in Node v4.4.5, and I've found that if I exhaust the 60 request/hour unauthenticated rate limit, then certain functions never call their callback. For example, the following script works normally until I hit the limit, then after that the callback never gets called.
Other methods, such as
User.getProfile()properly call the callback with an error object, complete with details of the 403 response from the API server. I haven't arrived at the root cause yet, but it is most likely inRequestable._requestAllPages.I'd be up for working on a PR for this, but first, testing for this issue should probably be done with fixture data for the HTTP responses, rather than hitting the GitHub servers directly. Do you have any preferences for which mocking library to use? I see that nock is a popular choice.