Open pmularien opened 6 years ago
@pmularien : appreciate you trying out this library, and the detailed bug report! At the very least, we could do a better job of providing a more informative error message, if not having designated logic to handle this rate limiting case.
If you file a PR, I'd be happy to pull it in for the next release :)
For the longer term, @Rishi, perhaps usage of a 429 status code might be appropriate: https://softwareengineering.stackexchange.com/questions/128512/suggested-http-rest-status-code-for-request-limit-reached
Hi @pmularien - just wanted to ping back to see if you were still interested in picking up this issue :)
Description
API limits enforced at the free tier are not handled gracefully (i.e. error / exception thrown).
What I Did
As expected, once I passed an API limit (not yet a paying customer, though I intend to pay shortly), I received an error because the Tiingo response is not JSON in this case:
The offending line:
This is because the response from the Tiingo API is:
... although the HTTP status is still
200 OK
(not great API design). Happy to submit a PR if you feel this should be fixed!