diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-11-19 11:21:12 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-11-19 11:21:12 +0100 |
commit | d2f47fd73fc8ed6d482547e6211ee02b92409537 (patch) | |
tree | 20a4b3a8ee005600849ca2aaddaeb6bac1e0758a /jdisc_http_service/src | |
parent | d2ee77fb37285fd3f2a3455863e0567e9b265e62 (diff) |
Server.start() now wraps BindException in IOException
https://github.com/eclipse/jetty.project/pull/3003
Diffstat (limited to 'jdisc_http_service/src')
-rw-r--r-- | jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java index 8074af7f64f..40be93f2111 100644 --- a/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java +++ b/jdisc_http_service/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyHttpServer.java @@ -41,6 +41,7 @@ import org.osgi.framework.ServiceReference; import javax.management.remote.JMXServiceURL; import javax.servlet.DispatcherType; +import java.io.IOException; import java.lang.management.ManagementFactory; import java.net.BindException; import java.net.MalformedURLException; @@ -302,9 +303,10 @@ public class JettyHttpServer extends AbstractServerProvider { public void start() { try { server.start(); - } catch (final BindException e) { - throw new RuntimeException("Failed to start server due to BindExecption. ListenPorts = " + listenedPorts.toString(), e); } catch (final Exception e) { + if (e instanceof IOException && e.getCause() instanceof BindException) { + throw new RuntimeException("Failed to start server due to BindExecption. ListenPorts = " + listenedPorts.toString(), e.getCause()); + } throw new RuntimeException("Failed to start server.", e); } } |