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/http/http.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/http/http.cpp')
-rw-r--r-- | yt/cpp/mapreduce/http/http.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/yt/cpp/mapreduce/http/http.cpp b/yt/cpp/mapreduce/http/http.cpp index 765a96f042..4bddeab86d 100644 --- a/yt/cpp/mapreduce/http/http.cpp +++ b/yt/cpp/mapreduce/http/http.cpp @@ -768,21 +768,21 @@ THttpResponse::THttpResponse( ErrorResponse_ = TErrorResponse(HttpCode_, Context_.RequestId); - auto logAndSetError = [&] (const TString& rawError) { + auto logAndSetError = [&] (int code, const TString& rawError) { YT_LOG_ERROR("RSP %v - HTTP %v - %v", Context_.RequestId, HttpCode_, rawError.data()); - ErrorResponse_->SetRawError(rawError); + ErrorResponse_->SetError(TYtError(code, rawError)); }; switch (HttpCode_) { case 429: - logAndSetError("request rate limit exceeded"); + logAndSetError(NClusterErrorCodes::NSecurityClient::RequestQueueSizeLimitExceeded, "request rate limit exceeded"); break; case 500: - logAndSetError(::TStringBuilder() << "internal error in proxy " << Context_.HostName); + logAndSetError(NClusterErrorCodes::NRpc::Unavailable, ::TStringBuilder() << "internal error in proxy " << Context_.HostName); break; default: { @@ -803,6 +803,9 @@ THttpResponse::THttpResponse( if (auto parsedResponse = ParseError(HttpInput_->Headers())) { ErrorResponse_ = parsedResponse.GetRef(); + if (HttpCode_ == 503) { + ExtendGenericError(*ErrorResponse_, NClusterErrorCodes::NBus::TransportError, "transport error"); + } } else { ErrorResponse_->SetRawError( errorString + " - X-YT-Error is missing in headers"); |