| 51 | } |
| 52 | |
| 53 | void RpcProtocolServerV1::WrapError(const Json::Value &request, int code, const std::string &message, Json::Value &result) { |
| 54 | result["error"]["code"] = code; |
| 55 | result["error"]["message"] = message; |
| 56 | result["result"] = Json::nullValue; |
| 57 | if (request.isObject() && request.isMember("id")) { |
| 58 | result["id"] = request["id"]; |
| 59 | } else { |
| 60 | result["id"] = Json::nullValue; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | void RpcProtocolServerV1::WrapException(const Json::Value &request, const JsonRpcException &exception, Json::Value &result) { |
| 65 | this->WrapError(request, exception.GetCode(), exception.GetMessage(), result); |
no outgoing calls
no test coverage detected