Skip to content

Commit dabc063

Browse files
authored
Merge pull request #40 from embulk/do_not_retry_connection_refused
Do not retry when "Connection refused" is returned and throw ConfigException
2 parents 1e31696 + 1c0b27e commit dabc063

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/org/embulk/input/sftp/SftpFileInput.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,10 @@ public boolean isRetryableException(Exception exception)
266266
{
267267
if (exception.getCause() != null && exception.getCause().getCause() != null) {
268268
Throwable cause = exception.getCause().getCause();
269-
if (cause.getMessage() != null && cause.getMessage().contains("Auth fail")) {
270-
throw new ConfigException(exception);
269+
if (cause.getMessage() != null) {
270+
if (cause.getMessage().contains("Auth fail") || cause.getMessage().contains("Connection refused")) {
271+
throw new ConfigException(exception);
272+
}
271273
}
272274
}
273275
if (exception instanceof ConfigException) {

0 commit comments

Comments
 (0)