EitherError
@ts-rust/std / Result / EitherError
Interface: EitherError<E>
Defined in: packages/std/src/result/interface.ts:97
Base interface for CheckedError instances, providing methods to inspect and handle the contained error.
Extends
Error
Type Parameters
Type Parameter |
---|
|
Properties
Property | Type | Inherited from | Defined in |
---|---|---|---|
|
| node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26 | |
|
| node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1077 | |
|
| node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1076 | |
|
| node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/lib/lib.es5.d.ts:1078 |
Methods
handle()
handle<T>(f, g): T;
Defined in: packages/std/src/result/interface.ts:105
Applies one of two functions to the contained error based on its type.
Applies the first function in case the inner error is unexpected
ResultError, or the second function if the inner error is
expected E
.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
| ( |
| ( |
Returns
T
isExpected()
isExpected(): this is ExpectedError<E>;
Defined in: packages/std/src/result/interface.ts:110
Checks if this is an expected error, narrowing to ExpectedError.
Returns
this is ExpectedError<E>
isUnexpected()
isUnexpected(): this is UnexpectedError<E>;
Defined in: packages/std/src/result/interface.ts:115
Checks if this is an unexpected error, narrowing to UnexpectedError.
Returns
this is UnexpectedError<E>