MCPcopy
hub / github.com/supermacro/neverthrow / errAsync

Function errAsync

src/result-async.ts:255–257  ·  view source on GitHub ↗
(err: E)

Source from the content-addressed store, hash-verified

253export function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E>
254export function errAsync<T = never, E extends void = void>(err: void): ResultAsync<T, void>
255export function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E> {
256 return new ResultAsync(Promise.resolve(new Err<T, E>(err)))
257}
258
259export const fromPromise = ResultAsync.fromPromise
260export const fromSafePromise = ResultAsync.fromSafePromise

Callers 8

index.test.tsFile · 0.90
safe-try.test.tsFile · 0.90
asyncBadFunction · 0.90
typecheck-tests.tsFile · 0.90
asyncAndThenMethod · 0.85
asyncAndThroughMethod · 0.85
asyncMapMethod · 0.85

Calls

no outgoing calls

Tested by 1

asyncBadFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…