Skip to content

Commit 6a503a9

Browse files
committed
ignore close error since they would be already closed by InputStream or something
1 parent 109f9f9 commit 6a503a9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/main/java/org/embulk/output/sftp/SftpFileOutput.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,21 @@ private void closeCurrentFile()
217217

218218
try {
219219
currentFileOutputStream.close();
220-
currentFile.getContent().close();
220+
}
221+
catch (IOException e) {
222+
logger.info(e.getMessage());
223+
}
224+
225+
try {
221226
currentFile.close();
222227
}
223228
catch (FileSystemException e) {
224-
IOException e) {
225-
logger.error(e.getMessage());
226-
Throwables.propagate(e);
227-
}
228-
finally {
229-
fileIndex++;
230-
currentFile = null;
231-
currentFileOutputStream = null;
229+
logger.warn(e.getMessage());
232230
}
231+
232+
fileIndex++;
233+
currentFile = null;
234+
currentFileOutputStream = null;
233235
}
234236

235237
private URI getSftpFileUri(String remoteFilePath)

0 commit comments

Comments
 (0)