merged duplicate code branches

This commit is contained in:
Alex Heneveld 2011-11-30 16:01:27 +00:00
parent d9ccd506e7
commit f55e4a5d3e
1 changed files with 2 additions and 7 deletions

View File

@ -231,13 +231,8 @@ public class SshjSshClient implements SshClient {
if (i + 1 == sshRetries) { if (i + 1 == sshRetries) {
logger.error(from, "<< " + errorMessage + ": out of retries %d", sshRetries); logger.error(from, "<< " + errorMessage + ": out of retries %d", sshRetries);
throw propagate(from, errorMessage); throw propagate(from, errorMessage);
} else if (Throwables2.getFirstThrowableOfType(from, IllegalStateException.class) != null) { } else if (shouldRetry(from) ||
logger.warn(from, "<< " + errorMessage + ": " + from.getMessage()); (Throwables2.getFirstThrowableOfType(from, IllegalStateException.class) != null)) {
backoffForAttempt(i + 1, errorMessage + ": " + from.getMessage());
if (connection != sshConnection)
connect();
continue;
} else if (shouldRetry(from)) {
logger.warn(from, "<< " + errorMessage + ": " + from.getMessage()); logger.warn(from, "<< " + errorMessage + ": " + from.getMessage());
backoffForAttempt(i + 1, errorMessage + ": " + from.getMessage()); backoffForAttempt(i + 1, errorMessage + ": " + from.getMessage());
if (connection != sshConnection) if (connection != sshConnection)