summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/http/host_manager.cpp
diff options
context:
space:
mode:
authorermolovd <[email protected]>2025-11-11 18:40:43 +0300
committerermolovd <[email protected]>2025-11-11 18:59:02 +0300
commit58a0bad8900e9f3fda91a860bcfe0a509fa71ed8 (patch)
treef6c8546320bbbd7eb17a50ac3271d9ea5f9fb4a0 /yt/cpp/mapreduce/http/host_manager.cpp
parent9491c44b064989a6fc7b0b2da1fa86192945727a (diff)
improve error message
commit_hash:f5a840952c97d019b950bc1093d1e379dcebbb6d
Diffstat (limited to 'yt/cpp/mapreduce/http/host_manager.cpp')
-rw-r--r--yt/cpp/mapreduce/http/host_manager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/yt/cpp/mapreduce/http/host_manager.cpp b/yt/cpp/mapreduce/http/host_manager.cpp
index e9716ec7a6e..3ad47be3297 100644
--- a/yt/cpp/mapreduce/http/host_manager.cpp
+++ b/yt/cpp/mapreduce/http/host_manager.cpp
@@ -4,7 +4,6 @@
#include "helpers.h"
#include "http.h"
#include "http_client.h"
-#include "requests.h"
#include <yt/cpp/mapreduce/interface/logging/yt_log.h>
@@ -124,8 +123,13 @@ THostManager::TClusterHostList THostManager::GetHosts(const TClientContext& cont
auto requestId = CreateGuidAsString();
// TODO: we need to set socket timeout here
UpdateHeaderForProxyIfNeed(context.ServerName, context, header);
- auto response = context.HttpClient->Request(GetFullUrlForProxy(context.ServerName, context, header), requestId, header);
+ auto url = GetFullUrlForProxy(context.ServerName, context, header);
+ auto response = context.HttpClient->Request(url, requestId, header);
auto hosts = ParseJsonStringArray(response->GetResponse());
+ if (hosts.empty()) {
+ const auto error = Format("Getting %Qv returned empty host list", url);
+ return TClusterHostList(std::make_exception_ptr(yexception() << error));
+ }
for (auto& host : hosts) {
host = CreateHostNameWithPort(host, context);
}