Specifies the failures to retryOn. Any failures that are assignable from the {@code failures} will be handled.

@throws NullPointerException if {@code failures} is null
@throws IllegalArgumentException if failures is empty
420093
public S handle(Class<? extends Throwable>... failures) {
    Assert.notNull(failures, "failures");
    Assert.isTrue(failures.length > 0, "Failures cannot be empty");
    return handle(Arrays.asList(failures));
  }
13818
private void fail(final K key) {
        final String methodName = "fail(): ";
        stateLock.writeLock().lock();
        try {
            Integer index = actualIndices.remove(key);
            if (index == null)
                throw new IllegalArgumentException("unknown key: " + key);
            elements[index] = FAILED;
            // register that this key failed
            (failedKeys == null ? failedKeys = new ArrayList<K>(actualIndices.size() + 1) : failedKeys).add(key);
            checkForCompletion();
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName, "permanent fail for key " + key);
            stateLock.postEvent();
        } finally {
            stateLock.writeLock().unlock();
        }
    }
773854
void setError(Exception error) {
    if (this.error != null) {
      throw new IllegalStateException(
          "Cannot reassign the error value of a response!");
    }
    this.error = error;
    this.complete = true;
    try {
      this.states.put(RESPONSE_COMPLETE);
    } catch (InterruptedException e) {
      log.error("Interrupted trying to indicate an error condition.", e);
    }
  }
81350
public void setOriginalException(Throwable originalException) {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "setOriginalException");
        _originalException = originalException;
        if (tc.isEntryEnabled())
            Tr.exit(tc, "setOriginalException");
    }
110823
public RetryerBuilder<V> retryIfException() {
        rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(Exception.class));
        return this;
    }
493520
public static ExecutionResult failure(Throwable failure) {
    return new ExecutionResult(null, failure, false, 0, true, false, false);
  }
1262389
public RetryerBuilder<V> retryIfResult(@Nonnull Predicate<V> resultPredicate) {
        Preconditions.checkNotNull(resultPredicate, "resultPredicate may not be null");
        rejectionPredicate = Predicates.or(rejectionPredicate, new ResultPredicate<V>(resultPredicate));
        return this;
    }
558896
public void onFailure(JoynrException newException) {
        exception = newException;
        status = new RequestStatus(RequestStatusCode.ERROR);
        try {
            statusLock.lock();
            statusLockChangedCondition.signalAll();
        } finally {
            statusLock.unlock();
        }
    }
1098132
protected void start(FailureHandler failureHandler) throws Exception {
		do {
			Throwable error = doStart();
			if (error == null) {
				return;
			}
			if (failureHandler.handle(error) == Outcome.ABORT) {
				return;
			}
		}
		while (true);
	}
394446
@Override
  public RetryDecision onErrorResponse(
      @NonNull Request request, @NonNull CoordinatorException error, int retryCount) {

    RetryDecision decision =
        (error instanceof ReadFailureException || error instanceof WriteFailureException)
            ? RetryDecision.RETHROW
            : RetryDecision.RETRY_NEXT;

    if (decision == RetryDecision.RETRY_NEXT && LOG.isTraceEnabled()) {
      LOG.trace(RETRYING_ON_ERROR, logPrefix, retryCount, error);
    }

    return decision;
  }
327403
public RetryPolicy<R> onFailedAttempt(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener) {
    failedAttemptListener = EventListener.ofAttempt(Assert.notNull(listener, "listener"));
    return this;
  }
1014054
def with_nullpointer_retry(max_retries = 3)
      tries = 0
      yield
    rescue java.lang.NullPointerException => e
      raise e if tries >= max_retries

      tries += 1
      warn "warning: celerity caught #{e} - retry ##{tries}"
      retry
    end
1147061
@Override
  public FutureResultImpl<T> setFailure(Throwable throwable) {
    this.throwable = throwable;
    failed = true;
    checkCallHandler();
    return this;
  }
642083
public void setUnsuccessful(java.util.Collection<UnsuccessfulItem> unsuccessful) {
        if (unsuccessful == null) {
            this.unsuccessful = null;
            return;
        }

        this.unsuccessful = new com.amazonaws.internal.SdkInternalList<UnsuccessfulItem>(unsuccessful);
    }
895202
synchronized void resetListFailed()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "resetListFailed");

    iRequestFailed = true;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "resetListFailed");
  }
89719
private void handleExceptions() throws RetriesExhaustedWithDetailsException {
    RetriesExhaustedWithDetailsException exceptions = getExceptions();
    if (exceptions != null) {
      listener.onException(exceptions, this);
    }
  }
905690
public void setFailureReason(List value) {
    List fr = new ArrayList(value);
    jmo.setField(TrmFirstContactAccess.BODY_CLIENTATTACHREPLY_FAILUREREASON, fr);
  }