diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-02-18 13:35:23 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-02-18 13:35:23 +0000 |
commit | d1f5b91da822b27faad83d50ecfdd2830a1be93e (patch) | |
tree | 78df3bf535cb8a5451afa402c51cb3f8d11b4d06 /yt/cpp/mapreduce/interface/errors.cpp | |
parent | 22bc9b81495143d67a93bf58c936c5d5a65c8e8e (diff) | |
parent | a2f16dc9eb108ecf11938c7c4275d701a3635bb7 (diff) | |
download | ydb-d1f5b91da822b27faad83d50ecfdd2830a1be93e.tar.gz |
Merge pull request #14716 from ydb-platform/merge-libs-250218-0050
Diffstat (limited to 'yt/cpp/mapreduce/interface/errors.cpp')
-rw-r--r-- | yt/cpp/mapreduce/interface/errors.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/yt/cpp/mapreduce/interface/errors.cpp b/yt/cpp/mapreduce/interface/errors.cpp index 42c7466dcb..fcc23fb3ac 100644 --- a/yt/cpp/mapreduce/interface/errors.cpp +++ b/yt/cpp/mapreduce/interface/errors.cpp @@ -332,7 +332,7 @@ bool TErrorResponse::IsFromTrailers() const bool TErrorResponse::IsTransportError() const { - return HttpCode_ == 503; + return Error_.ContainsErrorCode(NClusterErrorCodes::NBus::TransportError); } TString TErrorResponse::GetRequestId() const @@ -355,6 +355,22 @@ bool TErrorResponse::IsAccessDenied() const return Error_.ContainsErrorCode(NClusterErrorCodes::NSecurityClient::AuthorizationError); } +bool TErrorResponse::IsUnauthorized() const +{ + const auto allCodes = Error_.GetAllErrorCodes(); + for (auto code : { + NClusterErrorCodes::NRpc::AuthenticationError, + NClusterErrorCodes::NRpc::InvalidCsrfToken, + NClusterErrorCodes::NRpc::InvalidCredentials, + NClusterErrorCodes::NSecurityClient::AuthenticationError, + }) { + if (allCodes.contains(code)) { + return true; + } + } + return false; +} + bool TErrorResponse::IsConcurrentTransactionLockConflict() const { return Error_.ContainsErrorCode(NClusterErrorCodes::NCypressClient::ConcurrentTransactionLockConflict); |