From e53d880809d2616f7f6fa5df480996c44eddc66c Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 22 Sep 2009 21:16:54 +0000 Subject: [PATCH] Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47499 Don't swallow BindException git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@817843 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/net/JIoEndpoint.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java b/java/org/apache/tomcat/util/net/JIoEndpoint.java index 325059611..62e2ce7a9 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -233,12 +233,16 @@ public class JIoEndpoint extends AbstractEndpoint { } else { serverSocket = serverSocketFactory.createSocket(getPort(), getBacklog(), getAddress()); } - } catch (BindException be) { + } catch (BindException orig) { + String msg; if (getAddress() == null) - throw new BindException(be.getMessage() + ":" + getPort()); + msg = orig.getMessage() + " :" + getPort(); else - throw new BindException(be.getMessage() + " " + - getAddress().toString() + ":" + getPort()); + msg = orig.getMessage() + " " + + getAddress().toString() + ":" + getPort(); + BindException be = new BindException(msg); + be.initCause(orig); + throw be; } } //if( serverTimeout >= 0 ) -- 2.11.0