From 3b42785c57768e619ade198f7b4760e16288e0f3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 14 Jan 2023 11:12:21 +0100 Subject: Added config tests, moved from BSD license to CC0 --- http.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'http.cpp') diff --git a/http.cpp b/http.cpp index 868e739..893f1f0 100644 --- a/http.cpp +++ b/http.cpp @@ -6,6 +6,8 @@ #include "response.h" #include "websocket.h" +#include + #include #include @@ -326,7 +328,8 @@ public: acceptor_.open(endpoint.protocol(), ec); if (ec) { - fail(ec, "http listener open"); + //fail(ec, "http listener open"); + throw std::runtime_error(fmt::format("http listener open unsuccessful: {}:{}", endpoint.address().to_string(), endpoint.port())); return; } @@ -342,7 +345,8 @@ public: acceptor_.bind(endpoint, ec); if (ec) { - fail(ec, "http listener bind"); + //fail(ec, "http listener bind"); + throw std::runtime_error(fmt::format("http listener bind unsuccessful: {}:{}", endpoint.address().to_string(), endpoint.port())); return; } @@ -350,7 +354,8 @@ public: acceptor_.listen(net::socket_base::max_listen_connections, ec); if (ec) { - fail(ec, "http listener listen"); + //fail(ec, "http listener listen"); + throw std::runtime_error(fmt::format("http listen unsuccessful: {}:{}", endpoint.address().to_string(), endpoint.port())); return; } } -- cgit v1.2.3