diff options
author | nae202 <nae202@yandex-team.com> | 2024-11-20 12:52:01 +0300 |
---|---|---|
committer | nae202 <nae202@yandex-team.com> | 2024-11-20 13:14:09 +0300 |
commit | 0b9d91e900b52bccd6eabd033acbb57c4ee173fc (patch) | |
tree | 6839ed69fbda4d5214eb418acc4554924bc64160 /util/system/user.cpp | |
parent | 878e26057d11cce46b7bc3a6c838209d4686e28b (diff) | |
download | ydb-0b9d91e900b52bccd6eabd033acbb57c4ee173fc.tar.gz |
Part of PR. Style
Часть большого ПР REVIEW:7264088
commit_hash:0f5b03fbbed0ac30f734943309e3ef5cd4d7a30e
Diffstat (limited to 'util/system/user.cpp')
-rw-r--r-- | util/system/user.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/system/user.cpp b/util/system/user.cpp index 05439f8939..53767e8ff9 100644 --- a/util/system/user.cpp +++ b/util/system/user.cpp @@ -25,10 +25,11 @@ TString GetUsername() { DWORD len = (DWORD)Min(nameBuf.Size(), size_t(32767)); if (!GetUserNameA(nameBuf.Data(), &len)) { DWORD err = GetLastError(); - if ((err == ERROR_INSUFFICIENT_BUFFER) && (nameBuf.Size() <= 32767)) + if ((err == ERROR_INSUFFICIENT_BUFFER) && (nameBuf.Size() <= 32767)) { nameBuf = TTempBuf((size_t)len); - else + } else { ythrow TSystemError(err) << " GetUserName failed"; + } } else { return TString(nameBuf.Data(), (size_t)(len - 1)); } |