fcl-js
fcl-js copied to clipboard
[BUG] FCL transports don't surface resource exhausted errors to the user, or otherwise handle them
Current Behavior
If an application submits many requests, and exceeds the rate limit for an Access API, they will be returned either a GRPC ResourceExhausted error, or a 429 error for REST. FCL is not handling these errors, or surfacing them to the user, instead it returns this error:
"Response closed without headers\n at Object.onEnd (/app/node_modules/@onflow/transport-grpc/dist/sdk-send-grpc.js:55:28)\n at /app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:24233\n at /app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:11490\n at Array.forEach (<anonymous>)\n at e.rawOnError (/app/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.js:1:11452)\n at e.onTransportEnd "
Which does not provide sufficient information to the user to address the issue.
Expected Behavior
FCL should upon receiving a GRPC ResourceExhausted error, or a 429 error for REST:
- Surface the error to the user explaining they've exceeded the Access APIs rate limit/
- Automatically retry after some time until the request succeeds.
What are you currently working on that this is blocking?
No response