The successful value type for the result branch, defaulting to undefined.
The error type, defaulting to string.
Wraps this error in a higher-level error message.
The success value type of the wrapped result.
A context label or prefix to prepend to the original error.
A new Err instance whose message is prefixed with outerError.
Wraps this error and resolves it as a promise.
The success value type of the wrapped result.
A context label or prefix to prepend to the original error.
A promise that resolves to the wrapped error instance.
Recreates this error with a different success generic parameter.
This is useful when an operation fails but the type of a successful value changes in a surrounding call path.
The replacement success value type.
A new Err instance preserving the same error payload.
Represents a failed result.
This class is used as the error branch of Result. It stores the error value and exposes methods for composing and reusing error information.