diff options
author | pnv1 <pnv@ydb.tech> | 2023-05-23 12:15:53 +0300 |
---|---|---|
committer | pnv1 <pnv@ydb.tech> | 2023-05-23 12:15:53 +0300 |
commit | 5dce6a0c3ca260e259ac29941e7ce86a07467156 (patch) | |
tree | 85e0145c08f87f47318a9ec634618e692d7691c5 | |
parent | b521372ce98cf89c2f89ecce4c4c955bb7f10884 (diff) | |
download | ydb-5dce6a0c3ca260e259ac29941e7ce86a07467156.tar.gz |
Do not ignore errors while receiving token for static credentials
-rw-r--r-- | ydb/public/sdk/cpp/client/ydb_types/credentials/login/login.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ydb/public/sdk/cpp/client/ydb_types/credentials/login/login.cpp b/ydb/public/sdk/cpp/client/ydb_types/credentials/login/login.cpp index 6b08cfcc4b..48528e5971 100644 --- a/ydb/public/sdk/cpp/client/ydb_types/credentials/login/login.cpp +++ b/ydb/public/sdk/cpp/client/ydb_types/credentials/login/login.cpp @@ -167,10 +167,20 @@ TString TLoginCredentialsProvider::GetToken() const { } TString TLoginCredentialsProvider::GetError() const { - if (Response_.operation().issues_size() > 0) { - return Response_.operation().issues(0).message(); + if (Status_.Ok()) { + if (Response_.operation().issues_size() > 0) { + return Response_.operation().issues(0).message(); + } else { + return Ydb::StatusIds_StatusCode_Name(Response_.operation().status()); + } } else { - return Ydb::StatusIds_StatusCode_Name(Response_.operation().status()); + TStringBuilder str; + str << "Couldn't get token for provided credentials from " << Status_.Endpoint + << " with status " << Status_.Status << "."; + for (const auto& issue : Status_.Issues) { + str << Endl << "Issue: " << issue; + } + return str; } } |