Quck bail out when port can not be listened to.
@@ -55,7 +55,13 @@ void StatusWebServer::configure(std::unique_ptr<vespa::config::content::core::St
std::unique_ptr<WebServer> server;
// Negative port number means don't run the web server
if (newPort >= 0) {
+ try {
server.reset(new WebServer(*this, newPort));
+ } catch (const vespalib::PortListenException & e) {
+ LOG(error, "Failed listening to network port(%d) with protocol(%s): '%s', giving up and restarting.",
+ e.get_port(), e.get_protocol().c_str(), e.what());
+ std::quick_exit(17);
+ }
// Now that we know config update went well, update internal state
_port = server->getListenPort();
LOG(config, "Status pages now available on port %u", _port);
