tryCatch()
tryCatch<
E,A>(f,onRejected):TaskEither<E,A>
Creates a TaskEither from a Promise that may reject.
Type Parametersβ
E: Eβ
The error type.
A: Aβ
The success type.
Parametersβ
f: () => Promise<A>β
The async function to execute.
onRejected: (reason) => Eβ
Function to transform rejection reason.
Returns: TaskEither<E, A>β
A TaskEither containing the result or error.
Sinceβ
2.0.0