thenAttempt<S2> method

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

Chains another asynchronous function to be executed if the current task succeeds, while also catching any exceptions that may occur and converting them to failures.

Implementation

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