Convert a Promise<T> into a Promise<Result<T, E>>.
Promise<T>
Promise<Result<T, E>>
Resolves to Ok<T, E> when the promise fulfills, or to Err<T, E> when it rejects after mapping the rejection with onErr.
Ok<T, E>
Err<T, E>
onErr
the promise to observe
maps a thrown value to an error object of type E
E
a Promise<Result<T, E>>
Convert a
Promise<T>into aPromise<Result<T, E>>.Resolves to
Ok<T, E>when the promise fulfills, or toErr<T, E>when it rejects after mapping the rejection withonErr.