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

Add detail messages to particular cases for INVALID_PARAMS #5098

Closed
macfarla opened this issue Feb 16, 2023 · 4 comments
Closed

Add detail messages to particular cases for INVALID_PARAMS #5098

macfarla opened this issue Feb 16, 2023 · 4 comments
Assignees
Labels
dev experience The build system, things that enable easier development etc. good first issue Good for newcomers RPC snack Smaller coding task - less than a day for an experienced dev

Comments

@macfarla
Copy link
Contributor

"invalid params" error code is used a lot, but always with the same message, which can hide a lot of detail.

eg for #4212 it's hard to get any clues as to the nature of the problem. Could add further values to the JsonRpcError enum with the same code -32062 but with different messages that might help the user diagnose or at least report issues
eg
missing param
wrong type for param
unable to decode param (eg RLP)

JsonRpcError
INVALID_PARAMS(-32602, "Invalid params"),

@macfarla macfarla added RPC TeamRevenant GH issues worked on by Revenant Team labels Feb 16, 2023
@non-fungible-nelson non-fungible-nelson added the dev experience The build system, things that enable easier development etc. label Mar 2, 2023
@macfarla
Copy link
Contributor Author

Another instance - when transaction type is incorrect, eth_sendRawTransaction can respond with invalid params but it's not obvious what the problem is https://discord.com/channels/905194001349627914/938504958909747250/1108931495797727354

@chenqping
Copy link

yes, invalid params don't indication where is wrong

@macfarla
Copy link
Contributor Author

macfarla commented Jan 2, 2024

changed default to internal error not invalid params #5506

@macfarla
Copy link
Contributor Author

suggest to follow the pattern used here for peer disconnect reasons #6899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev experience The build system, things that enable easier development etc. good first issue Good for newcomers RPC snack Smaller coding task - less than a day for an experienced dev
Projects
None yet
Development

No branches or pull requests

5 participants