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.
master
Steve Wolter 2018-07-17 13:38:37 +02:00 committed by Wally B. Feed
parent 0ee06ba561
commit 6c31420b97
1 changed files with 11 additions and 3 deletions

View File

@ -168,7 +168,10 @@ bool PoseGraphStub::IsTrajectoryFinished(int trajectory_id) const {
request.set_trajectory_id(trajectory_id);
async_grpc::Client<handlers::IsTrajectoryFinishedSignature> 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<handlers::IsTrajectoryFrozenSignature> 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<mapping::PoseGraphInterface::Constraint>
PoseGraphStub::constraints() const {
google::protobuf::Empty request;
async_grpc::Client<handlers::GetConstraintsSignature> 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());
}