提交 911f4696 编写于 作者: K kohsuke

Improved error diagnostics in the update center when the proxy...

    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
上级 895e5ba1
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册