Skip to content

Class: Err<T, E>

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:39

Type Parameters

T

T

E

E

Implements

  • ResultInterface<T, E>

Constructors

Constructor

new Err<T, E>(error: E): Err<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:40

Parameters

error

E

Returns

Err<T, E>

Methods

isErr()

isErr(): this is Err<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:44

Returns true only if this contains an error and allows safe access to the value via result.error.

Returns

this is Err<T, E>

Implementation of

ResultInterface.isErr

isOk()

isOk(): this is Ok<T, E>;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:41

Returns true only if this contains a value and allows safe access to the value via result.value.

Returns

this is Ok<T, E>

Implementation of

ResultInterface.isOk

unwrap()

unwrap(): T;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:47

Returns the value if this contains a value, or throws the error.

Returns

T

Throws

E

Implementation of

ResultInterface.unwrap

Properties

error

readonly error: E;

Defined in: packages/boop-sdk/lib/utils/neverthrow.ts:40