diff --git a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java index b82339de9c687a5aa66fe5819ed62ecd53c5660f..359fc2b4a1f27f8174e83bbe025c23610ddb2b81 100644 --- a/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java +++ b/core/src/main/java/jenkins/slaves/restarter/JnlpSlaveRestarterInstaller.java @@ -36,14 +36,13 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser MasterComputer.threadPoolForRemoting.submit(new java.util.concurrent.Callable() { @Override public Void call() throws Exception { - final List restarters = new ArrayList(SlaveRestarter.all()); + try { + final List restarters = new ArrayList(SlaveRestarter.all()); - VirtualChannel ch = c.getChannel(); - if (ch==null) return null; // defensive check + VirtualChannel ch = c.getChannel(); + if (ch==null) return null; // defensive check - List effective = null; - try { - effective = ch.call(new Callable, IOException>() { + List effective = ch.call(new Callable, IOException>() { public List call() throws IOException { Engine e = Engine.current(); if (e == null) return null; // not running under Engine @@ -84,13 +83,12 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser return restarters; } }); - } catch (IOException e) { + + // TODO: report this to GUI + listener.getLogger().println("Effective SlaveRestarter on " + c.getDisplayName() + ": " + effective); + } catch (Throwable e) { e.printStackTrace(listener.error("Failed to install restarter")); - // don't let this fail the slave connection } - - // TODO: report this to GUI - listener.getLogger().println("Effective SlaveRestarter on " + c.getDisplayName() + ": " + effective); return null; } });