diff options
| author | achains <[email protected]> | 2026-02-23 19:41:41 +0300 |
|---|---|---|
| committer | achains <[email protected]> | 2026-02-23 20:06:19 +0300 |
| commit | 7f34ec4c3c7c098adefc6f556367e561ffac3cac (patch) | |
| tree | fd7d4787e2b8ea102f5bbf9f56f681d074389ac4 /yt/cpp/mapreduce/client/client.cpp | |
| parent | 60e7c24608d9147a3775ccc0327d7ddc29b63374 (diff) | |
YT-26837: do not log at Error level if error is expected
* Changelog entry
Type: fix
Component: cpp-sdk
Introduce TExpectedErrorGuard that prevents logging expected error at Error level in the scope.
<Message for release notes>
commit_hash:e11ec54f57024002d18c26edd3fdfc9a9bf1e3a7
Diffstat (limited to 'yt/cpp/mapreduce/client/client.cpp')
| -rw-r--r-- | yt/cpp/mapreduce/client/client.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/yt/cpp/mapreduce/client/client.cpp b/yt/cpp/mapreduce/client/client.cpp index 0fdcf8b4ccf..fa17cf5230c 100644 --- a/yt/cpp/mapreduce/client/client.cpp +++ b/yt/cpp/mapreduce/client/client.cpp @@ -16,6 +16,7 @@ #include "transaction_pinger.h" #include "yt_poller.h" +#include <yt/cpp/mapreduce/common/expected_error_guard.h> #include <yt/cpp/mapreduce/common/helpers.h> #include <yt/cpp/mapreduce/common/retry_lib.h> @@ -77,6 +78,11 @@ void ApplyProxyUrlAliasingRules( } } +bool IsCrossCellDisabledError(const TErrorResponse& e) +{ + return e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath); +} + //////////////////////////////////////////////////////////////////////////////// } // namespace @@ -209,6 +215,8 @@ TNodeId TClientBase::Copy( const TYPath& destinationPath, const TCopyOptions& options) { + TExpectedErrorGuard guard(IsCrossCellDisabledError); + try { return RequestWithRetry<TNodeId>( ClientRetryPolicy_->CreatePolicyForGenericRequest(), @@ -216,7 +224,7 @@ TNodeId TClientBase::Copy( return RawClient_->CopyInsideMasterCell(mutationId, TransactionId_, sourcePath, destinationPath, options); }); } catch (const TErrorResponse& e) { - if (e.GetError().ContainsErrorCode(NClusterErrorCodes::NObjectClient::CrossCellAdditionalPath)) { + if (IsCrossCellDisabledError(e)) { // Do transaction for cross cell copying. return RequestWithRetry<TNodeId>( ClientRetryPolicy_->CreatePolicyForGenericRequest(), |
