fauna / fauna-js

Javascript driver for Fauna v10 (current)
https://fauna.com
Other
37 stars 7 forks source link

Fix error code for ThrottlingError #264

Closed ptpaterson closed 6 months ago

ptpaterson commented 6 months ago

Ticket(s): FE-###

Problem

The error code for 429 throttling errors is limit_exceeded, but we are using throttle, 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 get ThrottlingError'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.