示例#1
0
文件: errors.cpp 项目: hadzim/bb
 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;
 }
示例#3
0
bool check_exception3(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_RPC_INVALID_REQUEST &&
         ex.GetData().size() == 2;
}
示例#4
0
bool check_exception2(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_CLIENT_INVALID_RESPONSE;
}
示例#5
0
bool check_exception1(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_RPC_JSON_PARSE_ERROR;
}
示例#6
0
 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();
}