mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-27 14:05:50 +00:00
Add rpcErrorString function
This commit is contained in:
@@ -260,7 +260,10 @@ inline Json::Value expected_field_error (
|
|||||||
/** Returns `true` if the json contains an rpc error specification. */
|
/** Returns `true` if the json contains an rpc error specification. */
|
||||||
bool contains_error (Json::Value const& json);
|
bool contains_error (Json::Value const& json);
|
||||||
|
|
||||||
}
|
} // RPC
|
||||||
|
|
||||||
|
/** Returns a single string with the contents of an RPC error. */
|
||||||
|
std::string rpcErrorString(Json::Value const& jv);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,5 +170,14 @@ bool contains_error (Json::Value const& json)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // RPC
|
||||||
|
|
||||||
|
std::string rpcErrorString(Json::Value const& jv)
|
||||||
|
{
|
||||||
|
assert(RPC::contains_error(jv));
|
||||||
|
return jv[jss::error].asString() +
|
||||||
|
jv[jss::error_message].asString();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
} // ripple
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user