From 6c31420b974a3ead500052cdb0a1b96b7a5dd29c Mon Sep 17 00:00:00 2001 From: Steve Wolter Date: Tue, 17 Jul 2018 13:38:37 +0200 Subject: [PATCH] Log status of failed RPCs in PoseGraphStub. (#1288) Log status of failed RPCs in PoseGraphStub. This improves the usefulness of error messages in the log. --- .../cloud/internal/client/pose_graph_stub.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cartographer/cloud/internal/client/pose_graph_stub.cc b/cartographer/cloud/internal/client/pose_graph_stub.cc index 8759550..f9de08b 100644 --- a/cartographer/cloud/internal/client/pose_graph_stub.cc +++ b/cartographer/cloud/internal/client/pose_graph_stub.cc @@ -168,7 +168,10 @@ bool PoseGraphStub::IsTrajectoryFinished(int trajectory_id) const { request.set_trajectory_id(trajectory_id); async_grpc::Client client( client_channel_); - CHECK(client.Write(request)); + ::grpc::Status status; + CHECK(client.Write(request, &status)) + << "Failed to check if trajectory " << trajectory_id + << " is finished: " << status.error_message(); return client.response().is_finished(); } @@ -177,7 +180,10 @@ bool PoseGraphStub::IsTrajectoryFrozen(int trajectory_id) const { request.set_trajectory_id(trajectory_id); async_grpc::Client client( client_channel_); - CHECK(client.Write(request)); + ::grpc::Status status; + CHECK(client.Write(request, &status)) + << "Failed to check if trajectory " << trajectory_id + << " is frozen: " << status.error_message(); return client.response().is_frozen(); } @@ -190,7 +196,9 @@ std::vector PoseGraphStub::constraints() const { google::protobuf::Empty request; async_grpc::Client client(client_channel_); - CHECK(client.Write(request)); + ::grpc::Status status; + CHECK(client.Write(request, &status)) + << "Failed to get constraints: " << status.error_message(); return mapping::FromProto(client.response().constraints()); }