Skip to content

Function wrap()

wrap<V, E>(callback: () => V, catcher?: (err: unknown) => E): Result<V, E>

Source: result.ts

Wraps a synchronous operation that might throw in a Result.

Type Parameters

V

V

E

E = Error

Parameters

callback

() => V

catcher?

(err: unknown) => E

Returns

Result<V, E>

Built by Prozilla