Search in sources :

Example 1 with ProcessTimeoutException

use of jetbrains.buildServer.ProcessTimeoutException in project teamcity-git by JetBrains.

the class CommandUtil method isRecoverable.

public static boolean isRecoverable(@NotNull Exception e, AuthSettings authSettings, int attempt, int maxAttempts) {
    boolean attemptsLeft = attempt < maxAttempts;
    if (e instanceof ProcessTimeoutException || e instanceof GitExecTimeout)
        return attemptsLeft;
    if (!(e instanceof VcsException))
        return false;
    final VcsException ve = (VcsException) e;
    if (isTimeoutError(ve) || isConnectionRefused(ve) || isConnectionReset(ve))
        return attemptsLeft;
    if (isCanceledError(ve))
        return false;
    if (e instanceof GitIndexCorruptedException)
        return false;
    if (authSettings.doesTokenNeedRefresh() && attempt == 1)
        return true;
    return attemptsLeft && !isRemoteAccessError(ve);
}
Also used : GitExecTimeout(jetbrains.buildServer.buildTriggers.vcs.git.command.errors.GitExecTimeout) GitIndexCorruptedException(jetbrains.buildServer.buildTriggers.vcs.git.command.errors.GitIndexCorruptedException) VcsException(jetbrains.buildServer.vcs.VcsException) ProcessTimeoutException(jetbrains.buildServer.ProcessTimeoutException)

Aggregations

ProcessTimeoutException (jetbrains.buildServer.ProcessTimeoutException)1 GitExecTimeout (jetbrains.buildServer.buildTriggers.vcs.git.command.errors.GitExecTimeout)1 GitIndexCorruptedException (jetbrains.buildServer.buildTriggers.vcs.git.command.errors.GitIndexCorruptedException)1 VcsException (jetbrains.buildServer.vcs.VcsException)1