summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--yt/cpp/mapreduce/http/http.cpp7
-rw-r--r--yt/cpp/mapreduce/http/http_client.cpp6
2 files changed, 7 insertions, 6 deletions
diff --git a/yt/cpp/mapreduce/http/http.cpp b/yt/cpp/mapreduce/http/http.cpp
index 47b9859605a..ae84926a2f3 100644
--- a/yt/cpp/mapreduce/http/http.cpp
+++ b/yt/cpp/mapreduce/http/http.cpp
@@ -783,6 +783,10 @@ THttpResponse::THttpResponse(
logAndSetError(NClusterErrorCodes::NRpc::Unavailable, ::TStringBuilder() << "internal error in proxy " << Context_.HostName);
break;
+ case 503:
+ logAndSetError(NClusterErrorCodes::NBus::TransportError, "service unavailable");
+ break;
+
default: {
TStringStream httpHeaders;
httpHeaders << "HTTP headers (";
@@ -801,9 +805,6 @@ THttpResponse::THttpResponse(
if (auto parsedResponse = ParseError(HttpInput_->Headers())) {
ErrorResponse_ = parsedResponse.GetRef();
- if (HttpCode_ == 503) {
- ExtendGenericError(*ErrorResponse_, NClusterErrorCodes::NBus::TransportError, "transport error");
- }
} else {
ErrorResponse_ = TErrorResponse(TYtError(errorString + " - X-YT-Error is missing in headers"), Context_.RequestId);
}
diff --git a/yt/cpp/mapreduce/http/http_client.cpp b/yt/cpp/mapreduce/http/http_client.cpp
index b22fcacb164..820bc0c36af 100644
--- a/yt/cpp/mapreduce/http/http_client.cpp
+++ b/yt/cpp/mapreduce/http/http_client.cpp
@@ -57,6 +57,9 @@ TMaybe<TErrorResponse> GetErrorResponse(const TString& hostName, const TString&
case NHttp::EStatusCode::InternalServerError:
return logAndSetError(NClusterErrorCodes::NRpc::Unavailable, "internal error in proxy " + hostName);
+ case NHttp::EStatusCode::ServiceUnavailable:
+ return logAndSetError(NClusterErrorCodes::NBus::TransportError, "service unavailable");
+
default: {
TStringStream httpHeaders;
httpHeaders << "HTTP headers (";
@@ -81,9 +84,6 @@ TMaybe<TErrorResponse> GetErrorResponse(const TString& hostName, const TString&
if (errorResponse.IsOk()) {
return Nothing();
}
- if (httpCode == NHttp::EStatusCode::ServiceUnavailable) {
- ExtendGenericError(errorResponse, NClusterErrorCodes::NBus::TransportError, "transport error");
- }
return errorResponse;
}