diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-12-18 11:40:52 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-12-18 11:40:52 -0800 |
commit | bb303513dce4e78d898035b9f7f5ae11b7b452dd (patch) | |
tree | 708cacfd6a93bdfff3fa76e813afe909f3e62fe6 /include/grpcpp/impl/codegen/client_unary_call.h | |
parent | 00c9c40004d011f01c72d253a530edb3364992bf (diff) | |
parent | d198607457a6f5d47e8c134277ebfe3706f9476b (diff) |
Merge master
Diffstat (limited to 'include/grpcpp/impl/codegen/client_unary_call.h')
-rw-r--r-- | include/grpcpp/impl/codegen/client_unary_call.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/grpcpp/impl/codegen/client_unary_call.h b/include/grpcpp/impl/codegen/client_unary_call.h index b1c80764f2..5151839412 100644 --- a/include/grpcpp/impl/codegen/client_unary_call.h +++ b/include/grpcpp/impl/codegen/client_unary_call.h @@ -69,13 +69,17 @@ class BlockingUnaryCallImpl { ops.ClientSendClose(); ops.ClientRecvStatus(context, &status_); call.PerformOps(&ops); - if (cq.Pluck(&ops)) { - if (!ops.got_message && status_.ok()) { - status_ = Status(StatusCode::UNIMPLEMENTED, - "No message returned for unary request"); - } - } else { - GPR_CODEGEN_ASSERT(!status_.ok()); + cq.Pluck(&ops); + // Some of the ops might fail. If the ops fail in the core layer, status + // would reflect the error. But, if the ops fail in the C++ layer, the + // status would still be the same as the one returned by gRPC Core. This can + // happen if deserialization of the message fails. + // TODO(yashykt): If deserialization fails, but the status received is OK, + // then it might be a good idea to change the status to something better + // than StatusCode::UNIMPLEMENTED to reflect this. + if (!ops.got_message && status_.ok()) { + status_ = Status(StatusCode::UNIMPLEMENTED, + "No message returned for unary request"); } } Status status() { return status_; } |