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

Align RPC error message to Ethereum's #1825

Open
1 of 2 tasks
victhorbi opened this issue Feb 17, 2025 · 2 comments
Open
1 of 2 tasks

Align RPC error message to Ethereum's #1825

victhorbi opened this issue Feb 17, 2025 · 2 comments

Comments

@victhorbi
Copy link
Collaborator

victhorbi commented Feb 17, 2025

Summary

We shall align the errors to Ethereum's.

Expected result is:

  • find out the proper error code for this exception
  • change the reference body below
{
    "jsonrpc": "2.0",
    "error": {
        "code": -32004,
        "message": "Method not supported"
    },
    "id": 9
}

And here's what we return:

{
    "jsonrpc": "2.0",
    "result": "METHOD NOT IMPLEMENTED",
    "id": 9
}
@claytonneal
Copy link
Member

think we should use these error codes:

https://ethereum-json-rpc.com/errors

which is linked to from the ethereum docs
"code": -32042, is probably a custom error code from QuickNode/Infura ?

@claytonneal
Copy link
Member

actually id be careful with the format - seems some RPC providers dont respect the RPC spec
we should probably look what Viem will de-serialise

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

No branches or pull requests

3 participants