From 15f256ccecddbdb1fddd71df6ca667d7f4cddbf6 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Wed, 3 Jan 2024 15:28:28 +0000 Subject: [PATCH] HPCC-31063 Improve the error message when failing to connect to a host ip Signed-off-by: Gavin Halliday --- common/thorhelper/thorsoapcall.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/thorhelper/thorsoapcall.cpp b/common/thorhelper/thorsoapcall.cpp index 814ba8b26a8..901eb9b9431 100644 --- a/common/thorhelper/thorsoapcall.cpp +++ b/common/thorhelper/thorsoapcall.cpp @@ -2407,6 +2407,9 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo checkTimeLimitExceeded(&remainingMS); Url &connUrl = master->proxyUrlArray.empty() ? url : master->proxyUrlArray.item(0); ep.set(connUrl.host.get(), connUrl.port); + if (ep.isNull()) + throw MakeStringException(-1, "Failed to resolve host '%s'", nullText(connUrl.host.get())); + checkTimeLimitExceeded(&remainingMS); // after ep.set which might make a potentially long getaddrinfo lookup ... if (strieq(url.method, "https")) proto = PersistentProtocol::ProtoTLS;