The promise from which to create the Task
.
Produce a Task<T, E>
from a Promise
, using a
.
To absorb all errors/rejections as unknown
, use the overload without an
onRejection
handler instead.
This does not (and by definition cannot) handle errors that happen during
construction of the Promise
, because those happen before this is called.
See safelyTry
, safelyTryOr
, or
safelyTryOrElse
for alternatives which accept a callback for
constructing a promise and can therefore handle errors thrown in the call.
Produce a
Task<T, unknown>
from aPromise
.To handle the error case and produce a
Task<T, E>
instead, use the overload the overload which accepts anonRejection
handler instead.This does not (and by definition cannot) handle errors that happen during construction of the
Promise
, because those happen before this is called. SeesafelyTry
,safelyTryOr
, orsafelyTryOrElse
for alternatives which accept a callback for constructing a promise and can therefore handle errors thrown in the call.