Json::Value Errors::GetErrorBlock(const Json::Value& request, const JsonRpcException& exc) { Json::Value error = GetErrorBlock(request, exc.GetCode()); std::string errorMessage = exc.GetMessage(); if ( not errorMessage.empty() ) error["error"]["message"] = errorMessage; return error; }
bool check_exception1(JsonRpcException const&ex) { return ex.GetCode() == Errors::ERROR_CLIENT_CONNECTOR; }
bool check_exception3(JsonRpcException const &ex) { return ex.GetCode() == Errors::ERROR_RPC_INVALID_REQUEST && ex.GetData().size() == 2; }
bool check_exception2(JsonRpcException const &ex) { return ex.GetCode() == Errors::ERROR_CLIENT_INVALID_RESPONSE; }
bool check_exception1(JsonRpcException const &ex) { return ex.GetCode() == Errors::ERROR_RPC_JSON_PARSE_ERROR; }
bool check_exception2(JsonRpcException const & ex) { return ex.GetCode() == Errors::ERROR_SERVER_PROCEDURE_SPECIFICATION_SYNTAX; }
void RpcProtocolServerV1::WrapException(const Json::Value &request, const JsonRpcException &exception, Json::Value &result) { this->WrapError(request, exception.GetCode(), exception.GetMessage(), result); result["error"]["data"] = exception.GetData(); }