diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-09-14 12:13:58 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-09-15 10:24:53 -0300 |
commit | 55566630c60d23993a52ed54c95e7891f4588d57 (patch) | |
tree | 5a8240923ad568e30388205f567798f88ab08095 /test/functional/rpc_help.py | |
parent | f523df1ee8661e0c4738694b9054952769bfff65 (diff) | |
download | bitcoin-55566630c60d23993a52ed54c95e7891f4588d57.tar.xz |
rpc: treat univalue type check error as RPC_TYPE_ERROR, not RPC_MISC_ERROR
By throwing a custom exception from `Univalue::checkType` (instead of a plain
std::runtime_error) and catching it on the RPC server request handler.
So we properly return RPC_TYPE_ERROR (-3) on arg type errors and
not the general RPC_MISC_ERROR (-1).
Diffstat (limited to 'test/functional/rpc_help.py')
-rwxr-xr-x | test/functional/rpc_help.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/rpc_help.py b/test/functional/rpc_help.py index 5b7e724728..f683577c47 100755 --- a/test/functional/rpc_help.py +++ b/test/functional/rpc_help.py @@ -92,7 +92,7 @@ class HelpRpcTest(BitcoinTestFramework): assert_raises_rpc_error(-1, 'help', node.help, 'foo', 'bar') # invalid argument - assert_raises_rpc_error(-1, "JSON value of type number is not of expected type string", node.help, 0) + assert_raises_rpc_error(-3, "JSON value of type number is not of expected type string", node.help, 0) # help of unknown command assert_equal(node.help('foo'), 'help: unknown command: foo') |