aboutsummaryrefslogtreecommitdiff
path: root/zenserver-test/zenserver-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver-test/zenserver-test.cpp')
-rw-r--r--zenserver-test/zenserver-test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp
index bc955727a..c83278fe7 100644
--- a/zenserver-test/zenserver-test.cpp
+++ b/zenserver-test/zenserver-test.cpp
@@ -332,6 +332,8 @@ HttpConnectionPool::~HttpConnectionPool()
std::unique_ptr<HttpClientConnection>
HttpConnectionPool::GetConnection()
{
+ using namespace fmt::literals;
+
zen::RwLock::ExclusiveLockScope ScopedLock(m_Lock);
if (m_AvailableConnections.empty())
@@ -347,7 +349,7 @@ HttpConnectionPool::GetConnection()
if (ErrCode)
{
- return nullptr;
+ zen::ThrowLastError("Unabled to resolve '{}'"_format(m_HostName));
}
asio::ip::tcp::socket Socket{m_Context};
@@ -355,7 +357,7 @@ HttpConnectionPool::GetConnection()
if (ErrCode)
{
- return nullptr;
+ zen::ThrowLastError("Failed connecting '{}:{}'"_format(m_HostName, m_Port));
}
return std::make_unique<HttpClientConnection>(m_Context, this, std::move(Socket));