diff --git a/src/webserver/Listener.h b/src/webserver/Listener.h index d848a107..07f7df52 100644 --- a/src/webserver/Listener.h +++ b/src/webserver/Listener.h @@ -240,12 +240,22 @@ public: // Bind to the server address acceptor_.bind(endpoint, ec); if (ec) - return; + { + BOOST_LOG_TRIVIAL(error) + << "Failed to bind to endpoint: " << endpoint + << ". message: " << ec.message(); + throw std::runtime_error("Failed to bind to specified endpoint"); + } // Start listening for connections acceptor_.listen(net::socket_base::max_listen_connections, ec); if (ec) - return; + { + BOOST_LOG_TRIVIAL(error) + << "Failed to listen at endpoint: " << endpoint + << ". message: " << ec.message(); + throw std::runtime_error("Failed to listen at specified endpoint"); + } } // Start accepting incoming connections