Enhance error handling in RPC functions for clearer messages#439
Enhance error handling in RPC functions for clearer messages#439
Conversation
|
@copilot review this PR |
Here's the review of the PR changes (commit
Added One pre-existing note (not introduced by this PR): the error code
Added CI: ✅ Build and tests passed ( Overall the changes are correct, well-scoped, and improve spec-compliance. The only suggestion for a follow-up is correcting the error code from |
|
@copilot correct the error code from -32601 to a server-error range code (e.g. -32000) for non-"method not found" failures. |
…32000 for server errors) Agent-Logs-Url: https://github.com/dappnode/StakingBrain/sessions/1094ca8d-5049-4c30-8350-bd459cfdb87d Co-authored-by: Marketen <36164126+Marketen@users.noreply.github.com>
Done in
|
toRpcErrorMessage()helper on the backend to always produce a string error messagetoErrorMessage()helper on the client to extract human-readable messages from JSON-RPC error responses-32601specifically for method-not-found, and-32000for all other caught server errors