mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
More specific RPC error reporting.
This commit is contained in:
@@ -21,6 +21,7 @@ Json::Value rpcError(int iError, Json::Value jvResult)
|
||||
{ rpcBAD_BLOB, "badBlob", "Blob must be a non-empty hex string." },
|
||||
{ rpcBAD_SEED, "badSeed", "Disallowed seed." },
|
||||
{ rpcBAD_SYNTAX, "badSyntax", "Syntax error." },
|
||||
{ rpcCOMMAND_MISSING, "commandMissing", "Missing command entry." },
|
||||
{ rpcDST_ACT_MALFORMED, "dstActMalformed", "Destination account is malformed." },
|
||||
{ rpcDST_ACT_MISSING, "dstActMissing", "Destination account does not exists." },
|
||||
{ rpcDST_AMT_MALFORMED, "dstAmtMalformed", "Destination amount/currency/issuer is malformed." },
|
||||
|
||||
@@ -45,6 +45,7 @@ enum {
|
||||
rpcQUALITY_MALFORMED,
|
||||
rpcBAD_BLOB,
|
||||
rpcBAD_SEED,
|
||||
rpcCOMMAND_MISSING,
|
||||
rpcDST_ACT_MALFORMED,
|
||||
rpcDST_ACT_MISSING,
|
||||
rpcDST_AMT_MALFORMED,
|
||||
|
||||
@@ -2553,10 +2553,10 @@ Json::Value RPCHandler::doInternal(Json::Value jvRequest)
|
||||
return RPCInternalHandler::runHandler(jvRequest["internal_command"].asString(), jvRequest["params"]);
|
||||
}
|
||||
|
||||
Json::Value RPCHandler::doCommand(Json::Value& jvRequest, int iRole)
|
||||
Json::Value RPCHandler::doCommand(const Json::Value& jvRequest, int iRole)
|
||||
{
|
||||
if (!jvRequest.isMember("command"))
|
||||
return rpcError(rpcINVALID_PARAMS);
|
||||
return rpcError(rpcCOMMAND_MISSING);
|
||||
|
||||
std::string strCommand = jvRequest["command"].asString();
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
RPCHandler(NetworkOPs* netOps);
|
||||
RPCHandler(NetworkOPs* netOps, InfoSub* infoSub);
|
||||
|
||||
Json::Value doCommand(Json::Value& jvRequest, int role);
|
||||
Json::Value doCommand(const Json::Value& jvRequest, int role);
|
||||
Json::Value doRpcCommand(const std::string& strCommand, Json::Value& jvParams, int iRole);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user