-
Notifications
You must be signed in to change notification settings - Fork 3
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
chainHead: Define error codes returned by the server #117
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Note that this shouldn't be a legitimate error. Subscription IDs can be strings, so there is an infinite number of possible IDs. Even if it wasn't infinite, the spec mentions that there's a maximum number of simultaneous |
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks for the reviews 🙏 |
This PR defined the error codes returned by the server:
-32800
two or more subscriptions requested for chainHead_follow-32801
block hash not reported by chainHead_follow or block hash has been unpinned-32802
chainHead_follow started with withRuntime == false-32803
chainHead_follow did not generate an operationWaitingForContinue eventThe following are errors defined in the JSON-RPC spec:
-32602
The provided parameter isn't one of the expected values, has different format or is missing-32603
Internal server error:This is done for consistency reasons, since at the moment the
chainHead_follow
is the only method that has an associated return code, although the other methods could still generate JSON-RPC errors.This ensures interoperability as both substrate and light-client implementations will return similar codes.
cc @tomaka @jsdw @josepot @bkchr