code: public RetryPolicy<R> onFailedAttempt(CheckedConsumer<? extends ExecutionAttemptedEvent<R>> listener) {
      failedAttemptListener = EventListener.ofAttempt(Assert.notNull(listener, "listener"));
      return this;
    }
docs: Registers the {@code listener} to be called when an execution attempt fails.