提交 db2acfd5 编写于 作者: K Kohsuke Kawaguchi

expand the scope of error handling

上级 c5d54fe9
......@@ -36,14 +36,13 @@ public class JnlpSlaveRestarterInstaller extends ComputerListener implements Ser
MasterComputer.threadPoolForRemoting.submit(new java.util.concurrent.Callable<Void>() {
@Override
public Void call() throws Exception {
final List<SlaveRestarter> restarters = new ArrayList<SlaveRestarter>(SlaveRestarter.all());
try {
final List<SlaveRestarter> restarters = new ArrayList<SlaveRestarter>(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<SlaveRestarter> effective = null;
try {
effective = ch.call(new Callable<List<SlaveRestarter>, IOException>() {
List<SlaveRestarter> effective = ch.call(new Callable<List<SlaveRestarter>, IOException>() {
public List<SlaveRestarter> 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;
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册