You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.
Exceptions should be caught in RPC methods implementation (and re-thrown as jsonrpc::JsonRpcException) in order to generate error response and not just crash.
At least in these methods I don't see proper handling of possible errors:
admin_eth_findBlock // invalid block hash will throw
admin_eth_newAccount // I think writing file on disk might throw
admin_addPeer // incorrect node address will throw
debug_traceBlock // will throw if RLP is incorrect hex string
debug_traceBlockByHash
personal_unlockAccount
1a. Many methods could be improved with better error messages (many report just "invalid params" for any possible error).
Sending RPC request with invalid json in body on Linux through HTTP results for me in curl: (52) Empty reply from server and Request timed out: timeout('timed out',) in jsonrpcproxy log.
On Windows curl just hangs never getting the response.
It should generate proper response with error message for this case.
The text was updated successfully, but these errors were encountered:
Hi @gumb0,
I am a new contributor and I'd like to take care of this issue. Could you give me some guidance on how to test the methods listed above? I have already implemented exception handling on some of them, but I need to test.
Hi @Manugal, thank you for your interest!
There's no good way to write autotests for RPC methods at the moment, but you should be able to manually check it by starting eth (without arguments it will just start the sync with the main net) and then using ethereum-console (https://github.com/ethereum/ethereum-console) to connect to the node and send RPC requests.
There were some changes in ethconsole lately, and I haven't tried it with a latest version, so let me know if it's not working at all and you need some assistance (maybe in Gitter it would be more convenient)
Note also: it's better to submit your changes as a PR as early as possible, than trying to finish big chunk of work first.
jsonrpc::JsonRpcException
) in order to generate error response and not just crash.At least in these methods I don't see proper handling of possible errors:
1a. Many methods could be improved with better error messages (many report just "invalid params" for any possible error).
curl: (52) Empty reply from server
andRequest timed out: timeout('timed out',)
in jsonrpcproxy log.On Windows curl just hangs never getting the response.
It should generate proper response with error message for this case.
The text was updated successfully, but these errors were encountered: