Source:
<code>private void copySlaveJar(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { String fileName = workingDirectory + "/slave.jar"; listener.getLogger().println(Messages.SSHLauncher_StartingSFTPClient(getTimestamp())); SFTPClient sftpClient = null; try { sftpClient = new SFTPClient(connection); try { SFTPv3FileAttributes fileAttributes = sftpClient._stat(workingDirectory); if (fileAttributes==null) { listener.getLogger().println(Messages.SSHLauncher_RemoteFSDoesNotExist(getTimestamp(), workingDirectory)); sftpClient.mkdirs(workingDirectory, 0700); } else if (fileAttributes.isRegularFile()) { throw new IOException(Messages.SSHLauncher_RemoteFSIsAFile(workingDirectory)); } try { sftpClient.rm(fileName); } catch (IOException e) { } listener.getLogger().println(Messages.SSHLauncher_CopyingSlaveJar(getTimestamp())); try { byte[] slaveJar = new Slave.JnlpJar("slave.jar").readFully(); OutputStream os = sftpClient.writeToFile(fileName); try { os.write(slaveJar); } finally { os.close(); } listener.getLogger().println(Messages.SSHLauncher_CopiedXXXBytes(getTimestamp(), slaveJar.length)); <START> } catch (Throwable e) { <END> throw new IOException2(Messages.SSHLauncher_ErrorCopyingSlaveJarTo(fileName), e); } } catch (Throwable e) { throw new IOException2(Messages.SSHLauncher_ErrorCopyingSlaveJarInto(workingDirectory), e); } } catch (IOException e) { if (sftpClient == null) { copySlaveJarUsingSCP(listener, workingDirectory); } else { throw e; } } finally { if (sftpClient != null) { sftpClient.close(); } } }</code><technical_language>Error passthrough is. Escalating Throwable a passthrough for Error is wrong</technical_language>

Target:
private void copySlaveJar(TaskListener listener, String workingDirectory) throws IOException, InterruptedException { String fileName = workingDirectory + "/slave.jar"; listener.getLogger().println(Messages.SSHLauncher_StartingSFTPClient(getTimestamp())); SFTPClient sftpClient = null; try { sftpClient = new SFTPClient(connection); try { SFTPv3FileAttributes fileAttributes = sftpClient._stat(workingDirectory); if (fileAttributes==null) { listener.getLogger().println(Messages.SSHLauncher_RemoteFSDoesNotExist(getTimestamp(), workingDirectory)); sftpClient.mkdirs(workingDirectory, 0700); } else if (fileAttributes.isRegularFile()) { throw new IOException(Messages.SSHLauncher_RemoteFSIsAFile(workingDirectory)); } try { sftpClient.rm(fileName); } catch (IOException e) { } listener.getLogger().println(Messages.SSHLauncher_CopyingSlaveJar(getTimestamp())); try { byte[] slaveJar = new Slave.JnlpJar("slave.jar").readFully(); OutputStream os = sftpClient.writeToFile(fileName); try { os.write(slaveJar); } finally { os.close(); } listener.getLogger().println(Messages.SSHLauncher_CopiedXXXBytes(getTimestamp(), slaveJar.length)); } catch (Error error) { throw error; } catch (Throwable e) { throw new IOException2(Messages.SSHLauncher_ErrorCopyingSlaveJarTo(fileName), e); } } catch (Error error) { throw error; } catch (Throwable e) { throw new IOException2(Messages.SSHLauncher_ErrorCopyingSlaveJarInto(workingDirectory), e); } } catch (IOException e) { if (sftpClient == null) { copySlaveJarUsingSCP(listener, workingDirectory); } else { throw e; } } finally { if (sftpClient != null) { sftpClient.close(); } } }