tryCatch
tryCatch<
E,A>(f,onError):TaskResult<E,A>
Defined in: Core/TaskResult.ts:44
Creates a TaskResult from a function that may throw.
Catches any errors and transforms them using the onError function.
The factory optionally receives an AbortSignal forwarded from the call site.
Type Parameters
Section titled “Type Parameters”E
A
Parameters
Section titled “Parameters”(signal?) => Promise<A>
onError
Section titled “onError”(e) => E
Returns
Section titled “Returns”TaskResult<E, A>