Esempio n. 1
0
File: errors.cpp Progetto: 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;
 }
Esempio n. 3
0
bool check_exception3(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_RPC_INVALID_REQUEST &&
         ex.GetData().size() == 2;
}
Esempio n. 4
0
bool check_exception2(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_CLIENT_INVALID_RESPONSE;
}
Esempio n. 5
0
bool check_exception1(JsonRpcException const &ex) {
  return ex.GetCode() == Errors::ERROR_RPC_JSON_PARSE_ERROR;
}
Esempio n. 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();
}