Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rate limit handling could be more explicit #168

Open
lagoa89 opened this issue May 19, 2021 · 0 comments
Open

Rate limit handling could be more explicit #168

lagoa89 opened this issue May 19, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lagoa89
Copy link

lagoa89 commented May 19, 2021

First off thanks to you all for devloping such a helpful library. I really appreciate it.

I'm making a call to a users timeline to retrieve mentions. When the rate limit is hit twitter returns a 429 response with "Rate limit exceeded" in the body. Twitter-lite throws the following error:
message: 'invalid json response body at https://api.twitter.com/2/users/****/mentions?tweet.fields=created_at%2Cauthor_id%2Cin_reply_to_user_id&max_results=100 reason: Unexpected token R in JSON at position 0', type: 'invalid-json'

It would be easier to handle this appropriately (e.g. exponential back-off) if the HTTP code was returned in the errors object.

I suspect twitter.js L104 is the reason this is thrown.

Please let me know if there is any more information you need. Thanks again.

@rlueder rlueder added enhancement New feature or request good first issue Good for newcomers labels Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Development

No branches or pull requests

2 participants