@praha/byethrow
    Preparing search index...

    Function fail

    Creates a Failure result from a given error. Automatically wraps the error in a Promise if it is asynchronous.

    The type of the error to wrap.

    A Result or ResultAsync depending on whether the input is a promise.

    import { Result } from '@praha/byethrow';

    const result = Result.fail('Something went wrong');
    // Result.Result<never, string>
    import { Result } from '@praha/byethrow';

    const result = Result.fail(Promise.resolve('Async error'));
    // Result.ResultAsync<never, string>
    import { Result } from '@praha/byethrow';

    const result = Result.fail();
    // Result.Result<never, void>

    combine - For combining multiple Results into a single Result.