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