From 2583a78abab439348d396a1c2e161727fc89ca7f Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 23 Dec 2022 18:47:16 +0800 Subject: [PATCH] revise codes. --- src/clients/storage/StorageClientBase-inl.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/clients/storage/StorageClientBase-inl.h b/src/clients/storage/StorageClientBase-inl.h index fc935c47bfa..6e069acc069 100644 --- a/src/clients/storage/StorageClientBase-inl.h +++ b/src/clients/storage/StorageClientBase-inl.h @@ -198,14 +198,19 @@ folly::Future> StorageClientBase(); - 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."); } }); }