Repository navigation
Put error text in message and omit data for automatic errors - #311
Open
MysticRyuujin wants to merge 1 commit into
Open
MysticRyuujin wants to merge 1 commit into
MysticRyuujin wants to merge 1 commit into
Conversation
Invalid params, uncaught exceptions and remote server errors now return the error text in `message` and no `data`. Before, `message` was "`<method>` raised an exception" and the text was in `data`. This changes the wire format for callers that read `data`.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The router builds three errors by itself: invalid params (
ParamsMismatchError), uncaught exceptions (CatchableError), and remote server errors. For these,messageis "<method>raised an exception" and the useful text is indata:datais meant to be machine-readable, and the Ethereum execution API spec now allows it only where a method declares it (ethereum/execution-apis#967). Other execution clients put this text inmessage.This PR puts the error text in
messageand sends nodataon these three paths:<method>raised an exception".ApplicationErrorand localRpcResponseErrorkeep the code, message and data that the caller sets.This changes the wire format for callers that read
dataon these errors. When nimbus-eth1 updates this dependency,tests/test_rpc.nim(debug_getRawBlockAccessList) must expectexc.msg == "Resource not found"and an emptyexc.data.