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

tryCatchIntoResult

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 tryCatchIntoResult<T>(producer: ProducerFn<T>): Result<T, unknown>;
§
tryCatchIntoResult<T>(producer: ProducerFn<T>): Result<T, unknown>
[src]

§Type Parameters

§Parameters

§
producer: ProducerFn<T>
[src]

§Return Type

§
Result<T, unknown>
[src]