Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

tryCatchIntoResultAsync

This function converts the returend value from producer into Ok(T). If producer throw a something, this returns it with wrapping Err(unknown).

NOTE:

  1. An user should narrow the scope of producer to make it predictable that is in Err(E).
  2. Basically, we don't recomment to use this to create a Result<T, E>. Generally, you should define an Err(E) by depending on an use case context Use this operator just to make a bridge to existing codebase that you cannot inspect deeply to details.
function tryCatchIntoResultAsync<T>(producer: AsyncProducerFn<T>): Promise<Result<T, unknown>>;
§
tryCatchIntoResultAsync<T>(producer: AsyncProducerFn<T>): Promise<Result<T, unknown>>
[src]

§Type Parameters

§Parameters

§
producer: AsyncProducerFn<T>
[src]

§Return Type

§
Promise<Result<T, unknown>>
[src]