Fix error code for ThrottlingError #264
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket(s): FE-###
Problem
The error code for 429 throttling errors is
limit_exceeded
, but we are usingthrottle
, an incorrect placeholder from preexisting code.See canonical list of error codes from core:
https://github.com/fauna/core/blob/395d2a23d83a95c42102d5b9d02d2b49b191720c/ext/api/src/main/scala/api/fql2/FQL2Response.scala#L281
Solution
Update the error code.
Result
Correct handling of 429 limit-exceeded errors.
Out of scope
Run query limits tests locally by default: FE-5412
Testing
Concourse pipeline covers tests for exceeding query limits.
I installed the local driver in an App I have that is known to have throughput issues. Before this fix, I incorrectly get
QueryRuntimeError
's. After this fix, I correctly getThrottlingError
's and automatic retries work.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.