Interface: Err<T>
Defined in: index.ts:47
Represents an error result containing an error value.
This interface is part of a discriminated union with Ok
to create the Result
type. Use the err()
function to create instances rather than constructing manually.
Example
typescript
const result: Err<string> = err("Something went wrong");
console.log(result.success); // false
console.log(result.error); // "Something went wrong"
Type Parameters
T
T
= any
The type of the error data
Properties
error
readonly
error:T
Defined in: index.ts:49
success
readonly
success:false
Defined in: index.ts:48