summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/interface/errors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'yt/cpp/mapreduce/interface/errors.cpp')
-rw-r--r--yt/cpp/mapreduce/interface/errors.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/yt/cpp/mapreduce/interface/errors.cpp b/yt/cpp/mapreduce/interface/errors.cpp
index 40a2d5234c0..fcc23fb3acb 100644
--- a/yt/cpp/mapreduce/interface/errors.cpp
+++ b/yt/cpp/mapreduce/interface/errors.cpp
@@ -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);