mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-19 01:55:48 +00:00
Show a more specific error when entering an invalid command on the CLI RPC.
This commit is contained in:
@@ -535,7 +535,7 @@ Json::Value RPCParser::parseCommand(std::string strMethod, Json::Value jvParams)
|
|||||||
|
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
{
|
{
|
||||||
return rpcError(rpcBAD_SYNTAX);
|
return rpcError(rpcUNKNOWN_COMMAND);
|
||||||
}
|
}
|
||||||
else if ((commandsA[i].iMinParams >= 0 && jvParams.size() < commandsA[i].iMinParams)
|
else if ((commandsA[i].iMinParams >= 0 && jvParams.size() < commandsA[i].iMinParams)
|
||||||
|| (commandsA[i].iMaxParams >= 0 && jvParams.size() > commandsA[i].iMaxParams))
|
|| (commandsA[i].iMaxParams >= 0 && jvParams.size() > commandsA[i].iMaxParams))
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ Json::Value rpcError(int iError, Json::Value jvResult)
|
|||||||
{ rpcSRC_ISR_MALFORMED, "srcIsrMalformed", "Source issuer is malformed." },
|
{ rpcSRC_ISR_MALFORMED, "srcIsrMalformed", "Source issuer is malformed." },
|
||||||
{ rpcSRC_UNCLAIMED, "srcUnclaimed", "Source account is not claimed." },
|
{ rpcSRC_UNCLAIMED, "srcUnclaimed", "Source account is not claimed." },
|
||||||
{ rpcTXN_NOT_FOUND, "txnNotFound", "Transaction not found." },
|
{ rpcTXN_NOT_FOUND, "txnNotFound", "Transaction not found." },
|
||||||
{ rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown command." },
|
{ rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown method." },
|
||||||
{ rpcWRONG_SEED, "wrongSeed", "The regular key does not point as the master key." },
|
{ rpcWRONG_SEED, "wrongSeed", "The regular key does not point as the master key." },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user