Skip to content
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

[client]: make batch request easiest to understand when a too large response occurs #1104

Open
niklasad1 opened this issue Apr 27, 2023 · 0 comments

Comments

@niklasad1
Copy link
Member

niklasad1 commented Apr 27, 2023

After some usages of the batch request API and if one constructs a too big request or response it's not easy to understand.
For instance the jsonrpsee server will reply with ["batch too large", "id": null] which we doesn't handle differently in the clients.

For the async-client/websocket client one would get some error message such Invalid RequestId which isn't user-friendly and a better log/error should be propagated to the user.

For the http client is possible to detect by matching on the error but one really have to downcast the error which isn't good either.

Thus,

  1. Provide concrete error types/variants instead of using anyhow::Error
  2. Add a some concrete error variant InvalidBatchResponse

Optionally, add some documentation that batch requests might bump into the max_request, max_response limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant