Function wrapAsyncThrowable
- wrapAsyncThrowable<E>(catcher): (<A, R>(body) => ((...args) => Promise<Result<E, R>>))
Returns (<A, R>(body) => ((...args) => Promise<Result<E, R>>))
The wrapped function.
- <A, R>(body): ((...args) => Promise<Result<E, R>>)
Parameters
body: ((...args) => Promise<R>)
- (...args): Promise<R>
Returns Promise<R>
Returns ((...args) => Promise<Result<E, R>>)
- (...args): Promise<Result<E, R>>
Returns Promise<Result<E, R>>
Wraps the return value of
body
into aResult
overPromise
.