Improved error diagnostics in the update center when the proxy configuration is likely necessary.

(<a href="http://www.nabble.com/update-center-proxy-td20205568.html">discussion</a>)

In 1.260

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13012 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-11-05 23:23:35 +00:00
1 parent 895e5ba1c3
commit 911f469631
2 files changed
+12 -1

No files matched your search

@@ -420,7 +420,15 @@ public class UpdateCenter extends AbstractModelObject {
public void run() {
try {
statuses.add(Messages.UpdateCenter_Status_CheckingInternet());
testConnection(new URL("http://www.google.com/"));
try {
testConnection(new URL("http://www.google.com/"));
} catch (IOException e) {
if(e.getMessage().contains("Connection timed out")) {
// Google can't be down, so this is probably a proxy issue
statuses.add(Messages.UpdateCenter_Status_ConnectionFailed("www.google.com"));
return;
}
}
statuses.add(Messages.UpdateCenter_Status_CheckingJavaNet());
testConnection(new URL("https://hudson.dev.java.net/?uctest"));
@@ -120,6 +120,9 @@ UpdateCenter.Status.Success=Success
UpdateCenter.Status.UnknownHostException=\
<span class=error>Failed to resolve host name {0}. \
Perhaps you need to <a href='../pluginManager/advanced'>configure HTTP proxy?</a></span>
UpdateCenter.Status.ConnectionFailed=\
<span class=error>Failed to connect to {0}. \
Perhaps you need to <a href='../pluginManager/advanced'>configure HTTP proxy?</a></span>
Permalink.LastBuild=Last build
Permalink.LastStableBuild=Last stable build