Rate limit headers not attached to error object
See original GitHub issueI am finding when i hit the twitter “friends/ids” endpoint 16 times the expected { errors: [ { message: 'Rate limit exceeded', code: 88 } ]
is thrown but does not contain _headers.
I am hoping to use e._headers[“x-rate-limit-reset”] to tell me when to continue my job as indicated in the documentation. (https://github.com/draftbit/twitter-lite/blob/master/README.md#api-errors)
I think it was broken in this merge: https://github.com/draftbit/twitter-lite/pull/75/files
By this line not throwing the json object & headers https://github.com/draftbit/twitter-lite/blob/b19263b1ce5afd7617583672575d317ad31acfc8/twitter.js#L100
If I can get your tests to run ill raise a PR and write a test.
Can i introduce Nock rather than actually hitting the twitter API to simulate these conditions?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
0.9.4 appears to work so far
This has resolved my issue. Thanks