tryCatch<C, L, R> function
ReaderTaskEither<C, L, R>
tryCatch<C, L, R>(
- FutureOr<
R> task(), - L onError(
- dynamic err,
- StackTrace stackTrace
Runs the given task, and returns the result as an Right.
If it throws an error, the the error is passed to onError
, which determines
the Left value.
Implementation
ReaderTaskEither<C, L, R> tryCatch<C, L, R>(
FutureOr<R> Function() task,
L Function(dynamic err, StackTrace stackTrace) onError,
) =>
ReaderTaskEither((r) => TE.tryCatch(task, onError));