Author: tellison
Date: Wed Apr 23 06:27:08 2008
New Revision: 650861
URL: http://svn.apache.org/viewvc?rev=650861&view=rev
Log:
Improve error message for failed FTP connections.
Modified:
harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java?rev=650861&r1=650860&r2=650861&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
Wed Apr 23 06:27:08 2008
@@ -183,22 +183,24 @@
ProxySelector selector = ProxySelector.getDefault();
Iterator<Proxy> iter = proxyList.iterator();
boolean connectOK = false;
+ String failureReason = ""; //$NON-NLS-1$
while (iter.hasNext() && !connectOK) {
currentProxy = iter.next();
try {
connectInternal();
connectOK = true;
} catch (IOException ioe) {
+ failureReason = ioe.getLocalizedMessage();
// If connect failed, callback "connectFailed"
// should be invoked.
if (null != selector && Proxy.NO_PROXY != currentProxy) {
- selector
- .connectFailed(uri, currentProxy.address(), ioe);
+ selector.connectFailed(uri, currentProxy.address(), ioe);
}
}
}
if (!connectOK) {
- throw new IOException(Msg.getString("K0097")); //$NON-NLS-1$
+ // K0097=Unable to connect to server\: {0}
+ throw new IOException(Msg.getString("K0097", failureReason)); //$NON-NLS-1$
}
}
}
|