aboutsummaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/http/http_client.cpp
diff options
context:
space:
mode:
authorermolovd <ermolovd@yandex-team.com>2024-11-19 10:54:24 +0300
committerermolovd <ermolovd@yandex-team.com>2024-11-19 11:06:45 +0300
commit7be946f684e606f5baa9e3a13401cc19b8ac9a3b (patch)
treea4d6ce2a580ba953a048a64bdedbda1f6c7a1d26 /yt/cpp/mapreduce/http/http_client.cpp
parent907667c6ffd6222845fe8e18fd548e508250b5d0 (diff)
downloadydb-7be946f684e606f5baa9e3a13401cc19b8ac9a3b.tar.gz
YT-22943: add context for system errors
* thrown system errors contain context (i.e. host method and request id that produced error) Type: feature Component: cpp-sdk commit_hash:af72a3a37785e9e373e816c2cc072df2076f821d
Diffstat (limited to 'yt/cpp/mapreduce/http/http_client.cpp')
-rw-r--r--yt/cpp/mapreduce/http/http_client.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/yt/cpp/mapreduce/http/http_client.cpp b/yt/cpp/mapreduce/http/http_client.cpp
index 97bf4a7703..7e9d761c3c 100644
--- a/yt/cpp/mapreduce/http/http_client.cpp
+++ b/yt/cpp/mapreduce/http/http_client.cpp
@@ -167,13 +167,12 @@ class TDefaultHttpClient
public:
IHttpResponsePtr Request(const TString& url, const TString& requestId, const THttpConfig& config, const THttpHeader& header, TMaybe<TStringBuf> body) override
{
- auto request = std::make_unique<THttpRequest>(requestId);
-
auto urlRef = NHttp::ParseUrl(url);
auto host = CreateHost(urlRef.Host, urlRef.PortStr);
- request->Connect(host, config.SocketTimeout);
- request->SmallRequest(header, body);
+ auto request = std::make_unique<THttpRequest>(requestId, host, header, config.SocketTimeout);
+
+ request->SmallRequest(body);
return std::make_unique<TDefaultHttpResponse>(std::move(request));
}
@@ -182,10 +181,9 @@ public:
auto urlRef = NHttp::ParseUrl(url);
auto host = CreateHost(urlRef.Host, urlRef.PortStr);
- auto request = std::make_unique<THttpRequest>(requestId);
+ auto request = std::make_unique<THttpRequest>(requestId, host, header, config.SocketTimeout);
- request->Connect(host, config.SocketTimeout);
- auto stream = request->StartRequest(header);
+ auto stream = request->StartRequest();
return std::make_unique<TDefaultHttpRequest>(std::move(request), stream);
}
};