tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r817843 - /tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
Date Tue, 22 Sep 2009 21:16:56 GMT
Author: markt
Date: Tue Sep 22 21:16:54 2009
New Revision: 817843

URL: http://svn.apache.org/viewvc?rev=817843&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47499
Don't swallow BindException

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=817843&r1=817842&r2=817843&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Tue Sep 22 21:16:54 2009
@@ -233,12 +233,16 @@
                 } else {
                     serverSocket = serverSocketFactory.createSocket(getPort(), getBacklog(),
getAddress());
                 }
-            } catch (BindException be) {
+            } catch (BindException orig) {
+                String msg;
                 if (getAddress() == null)
-                    throw new BindException(be.getMessage() + "<null>:" + getPort());
+                    msg = orig.getMessage() + " <null>:" + 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 )



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message