Skip to content

Commit

Permalink
revise codes.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Dec 23, 2022
1 parent bd32016 commit 613d079
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/clients/storage/StorageClientBase-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,19 @@ folly::Future<StatusOr<Response>> StorageClientBase<ClientType, ClientManagerTyp

using TransportException = apache::thrift::transport::TTransportException;
auto ex = exWrapper.get_exception<TransportException>();
if (ex && ex->getType() == TransportException::TIMED_OUT) {
LOG(ERROR) << "Request to " << host << " time out: " << ex->what();
return Status::Error("RPC failure in StorageClient, probably timeout: %s", ex->what());
if (ex) {
if (ex->getType() == TransportException::TIMED_OUT) {
LOG(ERROR) << "Request to " << host << " time out: " << ex->what();
return Status::Error("RPC failure in StorageClient with timeout: %s", ex->what());
} else {
LOG(ERROR) << "Request to " << host << " failed: " << ex->what();
return Status::Error("RPC failure in StorageClient: %s", ex->what());
}
} else {
auto partsId = getReqPartsId(request);
invalidLeader(spaceId, partsId);
LOG(ERROR) << "Request to " << host << " failed.";
return Status::Error("RPC failure in StorageClient, probably timeout.");
return Status::Error("RPC failure in StorageClient.");
}
});
}
Expand Down

0 comments on commit 613d079

Please sign in to comment.