File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
yt/cpp/mapreduce/interface Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,22 @@ bool TErrorResponse::IsAccessDenied() const
355
355
return Error_.ContainsErrorCode (NClusterErrorCodes::NSecurityClient::AuthorizationError);
356
356
}
357
357
358
+ bool TErrorResponse::IsUnauthorized () const
359
+ {
360
+ const auto allCodes = Error_.GetAllErrorCodes ();
361
+ for (auto code : {
362
+ NClusterErrorCodes::NRpc::AuthenticationError,
363
+ NClusterErrorCodes::NRpc::InvalidCsrfToken,
364
+ NClusterErrorCodes::NRpc::InvalidCredentials,
365
+ NClusterErrorCodes::NSecurityClient::AuthenticationError,
366
+ }) {
367
+ if (allCodes.contains (code)) {
368
+ return true ;
369
+ }
370
+ }
371
+ return false ;
372
+ }
373
+
358
374
bool TErrorResponse::IsConcurrentTransactionLockConflict () const
359
375
{
360
376
return Error_.ContainsErrorCode (NClusterErrorCodes::NCypressClient::ConcurrentTransactionLockConflict);
Original file line number Diff line number Diff line change @@ -182,6 +182,9 @@ class TErrorResponse
182
182
// / Check if error was caused by lack of permissions to execute request.
183
183
bool IsAccessDenied () const ;
184
184
185
+ // / Check if error was caused by authorization issues.
186
+ bool IsUnauthorized () const ;
187
+
185
188
// / Check if error was caused by failure to lock object because of another transaction is holding lock.
186
189
bool IsConcurrentTransactionLockConflict () const ;
187
190
You can’t perform that action at this time.
0 commit comments