mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-23 03:55:49 +00:00
Better error messages for out of range integral values
* This change passes detailed error messages from the JSON parser on the server side, back to the client for inclusion into the reply's error message. * Errors originating from the server's inability to parse are reclassified from rpcINTERNAL to rpcINVALID_PARAMS.
This commit is contained in:
@@ -121,6 +121,20 @@ class LedgerRPC_test : public beast::unit_test::suite
|
||||
checkErrorValue(jrr, "invalidParams", "Invalid parameters.");
|
||||
}
|
||||
|
||||
{
|
||||
// Request a ledger with a very large (double) sequence.
|
||||
auto const ret = env.rpc (
|
||||
"json", "ledger", "{ \"ledger_index\" : 2e15 }");
|
||||
BEAST_EXPECT (RPC::contains_error(ret));
|
||||
BEAST_EXPECT (ret[jss::error_message] == "Invalid parameters.");
|
||||
}
|
||||
|
||||
{
|
||||
// Request a ledger with very large (integer) sequence.
|
||||
auto const ret = env.rpc (
|
||||
"json", "ledger", "{ \"ledger_index\" : 1000000000000000 }");
|
||||
checkErrorValue(ret, "invalidParams", "Invalid parameters.");
|
||||
}
|
||||
}
|
||||
|
||||
void testLedgerCurrent()
|
||||
|
||||
Reference in New Issue
Block a user