-
Notifications
You must be signed in to change notification settings - Fork 40
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 Limitation not reported #390
Comments
Thanks for reporting this @kcphysics. I'll check it out. |
Hey @kcphysics, there is a couple things happening here. There was a bug in the tracing code where we were not reporting the trace when there was an error. Obviously, this information is most needed when there is an API error so you can debug things. Thank you for reporting this as it'll really help people going forward. Here's what the trace will look like now (with status code):
There was a second issue though with your example in that the for iter.Next() {
if iter.Err() != nil {
log.Fatal(iter.Err())
}
count += 1
} You can change the code to look like this you'll capture the error. for iter.Next() {
count += 1
}
if iter.Err() != nil {
log.Fatal(iter.Err())
} With the added trace fix you'll see something like this following (although you don't need the trace fix to still see the error):
Again, thanks again for reporting this. |
Thanks! I appreciate the clarity and action! |
Describe the bug
Rate Limitation is not correctly being detected and reported
To Reproduce
Run the snippet of code below multiple times until you hit your rate limit:
Expected behavior
When rate limitation is reached,
iter.Err
contains an error stating that the rate limitation has been encounteredScreenshots
Output from the snipped above:
Additional context
I've tried this several different ways, but there's not "good" way to detect the rate limitation, and we cannot inspect the response inside of the Polygon.io client.
The text was updated successfully, but these errors were encountered: