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

unwrapOrThrowForResult

Unwraps input, returns the content of an Ok(T). Otherwise, this function throw a new Error instance with setting the original E in Err(E) to .cause property of the Error instance.

This matches the convention that is "a thrown object is always an Error instance". To achive this, this function requires Error.cause to carry the failure reason.

We DO NOT RECCOMEND TO USE THIS function generally.

This function is provided only to improve an interoperability with the world using "throw error" convention. We do not recommend to use this function.

function unwrapOrThrowForResult<T, E>(input: Result<T, E>): T;
§
unwrapOrThrowForResult<T, E>(input: Result<T, E>): T
[src]

§Type Parameters

§Parameters

§
input: Result<T, E>
[src]

§Return Type