mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 18:46:41 +00:00
[FIXED HUDSON-1894] Add hyperlink to error message when showing UnknownHostException
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10309 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
7cdce2fb9e
commit
07f1fbb0fe
2 files changed
+9
-1
No files matched your search
@@ -22,6 +22,7 @@ import java.io.InputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -366,11 +367,18 @@ public class UpdateCenter implements ModelObject {
|
||||
testConnection(new URL("https://hudson.dev.java.net/?uctest"));
|
||||
|
||||
statuses.add("Success");
|
||||
} catch (UnknownHostException e) {
|
||||
statuses.add("<span class=error>Failed to resolve host name "+e.getMessage()+". Perhaps you need to <a href='../pluginManager/advanced'>configure HTTP proxy?</a></span>");
|
||||
addStatus(e);
|
||||
} catch (IOException e) {
|
||||
statuses.add(Functions.printThrowable(e));
|
||||
}
|
||||
}
|
||||
|
||||
private void addStatus(UnknownHostException e) {
|
||||
statuses.add("<pre>"+ Functions.xmlEscape(Functions.printThrowable(e))+"</pre>");
|
||||
}
|
||||
|
||||
public String[] getStatuses() {
|
||||
synchronized (statuses) {
|
||||
return statuses.toArray(new String[statuses.size()]);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<td id="prepStatus${size(statuses)}">
|
||||
<ul>
|
||||
<j:forEach var="s" items="${statuses}">
|
||||
<li><pre>${s}</pre></li>
|
||||
<li>${s}</li>
|
||||
</j:forEach>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
Reference in new issue
Block a user