thenAttempt<S2> method

ResStream<S2, F> thenAttempt<S2>({
  1. required FutureOr<S2> run(
    1. S ok
    ),
  2. required F handle(
    1. Object e
    ),
})

Runs a function that may throw with each success value, catching a throw as Task.attempt does. Failures skip it.

Steps run one at a time, as with then.

Implementation

ResStream<S2, F> thenAttempt<S2>({
  required FutureOr<S2> Function(S ok) run,
  required F Function(Object e) handle,
}) => ResStream._(_stream.thenAttempt(run: run, handle: handle));