diff --git a/core/src/main/java/hudson/slaves/SlaveComputer.java b/core/src/main/java/hudson/slaves/SlaveComputer.java index 31650d18aa7e..2891af7c2a05 100644 --- a/core/src/main/java/hudson/slaves/SlaveComputer.java +++ b/core/src/main/java/hudson/slaves/SlaveComputer.java @@ -76,7 +76,6 @@ import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import javax.annotation.OverridingMethodsMustInvokeSuper; -import javax.servlet.ServletException; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -716,7 +715,7 @@ public List getLogRecords() throws IOException, InterruptedException } @RequirePOST - public HttpResponse doDoDisconnect(@QueryParameter String offlineMessage) throws IOException, ServletException { + public HttpResponse doDoDisconnect(@QueryParameter String offlineMessage) { if (channel!=null) { //does nothing in case computer is already disconnected checkPermission(DISCONNECT); @@ -741,11 +740,18 @@ public void run() { } @RequirePOST - public void doLaunchSlaveAgent(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + @Override + public void doLaunchSlaveAgent(StaplerRequest req, StaplerResponse rsp) throws IOException { checkPermission(CONNECT); if(channel!=null) { - req.getView(this,"already-launched.jelly").forward(req, rsp); + try { + req.getView(this, "already-launched.jelly").forward(req, rsp); + } catch (IOException x) { + throw x; + } catch (/*Servlet*/Exception x) { + throw new IOException(x); + } return; } @@ -778,7 +784,7 @@ public Slave.JnlpJar getJnlpJars(String fileName) { } @WebMethod(name="slave-agent.jnlp") - public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) throws IOException, ServletException { + public HttpResponse doSlaveAgentJnlp(StaplerRequest req, StaplerResponse res) { return new EncryptedSlaveAgentJnlpFile(this, "slave-agent.jnlp.jelly", getName(), CONNECT); }