public static boolean isRecoverable()

in git-common/src/main/java/jetbrains/buildServer/buildTriggers/vcs/git/command/impl/CommandUtil.java [215:242]


  public static boolean isRecoverable(@NotNull Exception e, @NotNull AuthSettings authSettings, int attempt, int maxAttempts, @NotNull Collection<String> customRecoverableMessages) {
    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 (isSslError(ve)) return false;

    if ((attempt == 1 || attemptsLeft) && shouldHandleRemoteRefNotFound() && isNotFoundRemoteRefError(ve))
      return true;

    if (isRemoteAccessError(ve)) return false;
    if (e instanceof GitIndexCorruptedException) return false;
    if (e.getCause() instanceof SshKeyNotFoundException) return false;

    if ((attempt == 1 || attemptsLeft) && authSettings.doesTokenNeedRefresh())
      return true;

    for (String message : customRecoverableMessages) {
      if (isMessageContains(ve, message)) return attemptsLeft;
    }

    return attemptsLeft;
  }