diff options
| author | Martin Ridgers <[email protected]> | 2021-11-24 15:55:42 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-11-24 16:17:44 +0100 |
| commit | 83b627398263b293b41074dae139d754cd9cd822 (patch) | |
| tree | 53132042abaaf14e1e0286c36f58257df814d8e0 /zenserver-test/zenserver-test.cpp | |
| parent | Moved librt dependency specification to zencore/xmake.lua (diff) | |
| download | zen-83b627398263b293b41074dae139d754cd9cd822.tar.xz zen-83b627398263b293b41074dae139d754cd9cd822.zip | |
Raise an error if zenserver-test's HTTP clients are enable to connect
Diffstat (limited to 'zenserver-test/zenserver-test.cpp')
| -rw-r--r-- | zenserver-test/zenserver-test.cpp | 6 |
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)); |