Task<S, F>.attempt constructor

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

Attempts to execute an asynchronous function and captures any exceptions as failures.

Implementation

Task.attempt({
  required FutureOr<S> Function() run,
  required F Function(Object e) handle,
}) : this._(t.Task.attempt(run: run, handle: handle));