MCPcopy Create free account
hub / github.com/bcndev/bytecoin / create_binary_response_error_body

Function create_binary_response_error_body

src/http/JsonRpc.cpp:147–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 return ps_req.to_string();
146}
147std::string create_binary_response_error_body(const Error &error, const common::JsonValue &jid) {
148 // static_assert(std::is_base_of<json_rpc::Error, ErrorType>::value, "ErrorType must be an json_rpc::Error
149 // descendant");
150 common::JsonValue ps_req(common::JsonValue::OBJECT);
151 ps_req.set("jsonrpc", std::string("2.0"));
152 ps_req.set("id", jid);
153 ps_req.set("error", seria::to_json_value(error));
154 std::string json_body = ps_req.to_string();
155 json_body += char(0);
156 return json_body;
157}
158
159std::string prepare_result_prefix(const common::JsonValue &jid) {
160 std::string result = "{";

Callers 1

on_binary_rpcMethod · 0.85

Calls 2

to_json_valueFunction · 0.85
to_stringMethod · 0.45

Tested by

no test coverage detected