diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-06-16 13:12:33 -0700 |
---|---|---|
committer | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2015-06-16 13:12:33 -0700 |
commit | 32f020ae2a4c01eba236b3a93251ef9c18f606ec (patch) | |
tree | 8d4a5bd9906729838587bb8d28c8bb0ce260da7a /src | |
parent | 7d7e640b23a1d261d4ae64505b186dabf5204ba7 (diff) | |
parent | c1a2c314fb45dafe73b01db23944503cf8961330 (diff) |
Merge pull request #2079 from yang-g/statusChange
Update the Status API
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/cpp_generator.cc | 8 | ||||
-rw-r--r-- | src/cpp/client/client_unary_call.cc | 2 | ||||
-rw-r--r-- | src/cpp/common/call.cc | 4 | ||||
-rw-r--r-- | src/cpp/util/status.cc | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index c00c85bb90..6cd615019b 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -854,7 +854,7 @@ void PrintSourceServerMethod(grpc::protobuf::io::Printer *printer, printer->Print(" (void) response;\n"); printer->Print( " return ::grpc::Status(" - "::grpc::StatusCode::UNIMPLEMENTED);\n"); + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); printer->Print("}\n\n"); } else if (ClientOnlyStreaming(method)) { printer->Print(*vars, @@ -867,7 +867,7 @@ void PrintSourceServerMethod(grpc::protobuf::io::Printer *printer, printer->Print(" (void) response;\n"); printer->Print( " return ::grpc::Status(" - "::grpc::StatusCode::UNIMPLEMENTED);\n"); + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); printer->Print("}\n\n"); } else if (ServerOnlyStreaming(method)) { printer->Print(*vars, @@ -880,7 +880,7 @@ void PrintSourceServerMethod(grpc::protobuf::io::Printer *printer, printer->Print(" (void) writer;\n"); printer->Print( " return ::grpc::Status(" - "::grpc::StatusCode::UNIMPLEMENTED);\n"); + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); printer->Print("}\n\n"); } else if (BidiStreaming(method)) { printer->Print(*vars, @@ -892,7 +892,7 @@ void PrintSourceServerMethod(grpc::protobuf::io::Printer *printer, printer->Print(" (void) stream;\n"); printer->Print( " return ::grpc::Status(" - "::grpc::StatusCode::UNIMPLEMENTED);\n"); + "::grpc::StatusCode::UNIMPLEMENTED, \"\");\n"); printer->Print("}\n\n"); } } diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 7e7ea78bcd..55e589306f 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -57,7 +57,7 @@ Status BlockingUnaryCall(ChannelInterface* channel, const RpcMethod& method, buf.AddClientSendClose(); buf.AddClientRecvStatus(context, &status); call.PerformOps(&buf); - GPR_ASSERT((cq.Pluck(&buf) && buf.got_message) || !status.IsOk()); + GPR_ASSERT((cq.Pluck(&buf) && buf.got_message) || !status.ok()); return status; } diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index 3212f770f4..edce6396bd 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -214,8 +214,8 @@ void CallOpBuffer::AddServerSendStatus( trailing_metadata_count_ = 0; } send_status_available_ = true; - send_status_code_ = static_cast<grpc_status_code>(status.code()); - send_status_details_ = status.details(); + send_status_code_ = static_cast<grpc_status_code>(status.error_code()); + send_status_details_ = status.error_message(); } void CallOpBuffer::FillOps(grpc_op* ops, size_t* nops) { diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index b694a513e7..5bb9eda3d9 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -36,6 +36,6 @@ namespace grpc { const Status& Status::OK = Status(); -const Status& Status::Cancelled = Status(StatusCode::CANCELLED); +const Status& Status::CANCELLED = Status(StatusCode::CANCELLED, ""); } // namespace grpc |