Skip to content

Commit 5d3a593

Browse files
committed
throw URISyntaxException as RuntimeException
1 parent d6ebac5 commit 5d3a593

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ public void nextFile()
118118
logger.error(e.getMessage());
119119
Throwables.propagate(e);
120120
}
121-
catch (URISyntaxException e) {
122-
logger.error(e.getMessage());
123-
Throwables.propagate(e);
124-
}
125121
}
126122

127123
@Override
@@ -186,9 +182,14 @@ private void closeCurrentFile()
186182
}
187183

188184
private URI getSftpFileUri(String remoteFilePath)
189-
throws URISyntaxException
190185
{
191-
return new URI("sftp", userInfo, host, port, remoteFilePath, null, null);
186+
try {
187+
return new URI("sftp", userInfo, host, port, remoteFilePath, null, null);
188+
}
189+
catch (URISyntaxException e) {
190+
logger.error(e.getMessage());
191+
throw new RuntimeException(e);
192+
}
192193
}
193194

194195
private String getOutputFilePath()

0 commit comments

Comments
 (0)