aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end/test_service_impl.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-04-12 06:44:00 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-04-12 06:44:00 -0700
commitc20fa90c6094599540e3a7ef16a5aa381580be33 (patch)
tree10233657606d5207a83bcebb36b8676dad459655 /test/cpp/end2end/test_service_impl.cc
parentd4e9a4863a25f40389db01347aaabcb798dc9138 (diff)
parentf200f25d4dad5b74e7216a2b17fa2c2783ceb40e (diff)
Merge github.com:grpc/grpc into cpparena
Diffstat (limited to 'test/cpp/end2end/test_service_impl.cc')
-rw-r--r--test/cpp/end2end/test_service_impl.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/cpp/end2end/test_service_impl.cc b/test/cpp/end2end/test_service_impl.cc
index 11729c425c..b473dd1f52 100644
--- a/test/cpp/end2end/test_service_impl.cc
+++ b/test/cpp/end2end/test_service_impl.cc
@@ -92,6 +92,11 @@ Status TestServiceImpl::Echo(ServerContext* context, const EchoRequest* request,
gpr_log(GPR_ERROR, "The request should not reach application handler.");
GPR_ASSERT(0);
}
+ if (request->has_param() && request->param().has_expected_error()) {
+ const auto& error = request->param().expected_error();
+ return Status(static_cast<StatusCode>(error.code()), error.error_message(),
+ error.binary_error_details());
+ }
int server_try_cancel = GetIntValueFromMetadata(
kServerTryCancelRequest, context->client_metadata(), DO_NOT_CANCEL);
if (server_try_cancel > DO_NOT_CANCEL) {