mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 14:35:52 +00:00
Refactor RPC commands with no arguments.
This commit is contained in:
@@ -77,11 +77,14 @@ Json::Value WSConnection::invokeCommand(Json::Value& jvRequest)
|
||||
// Currently we will simply unwrap errors returned by the RPC
|
||||
// API, in the future maybe we can make the responses
|
||||
// consistent.
|
||||
//
|
||||
// Regularize result. This is duplicate code.
|
||||
if (jvResult["result"].isObject() && jvResult["result"].isMember("error"))
|
||||
{
|
||||
jvResult = jvResult["result"];
|
||||
jvResult = jvResult["result"];
|
||||
jvResult["status"] = "error";
|
||||
jvResult["request"] = jvRequest;
|
||||
|
||||
} else {
|
||||
jvResult["status"] = "success";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user