Staquia API
    Preparing search index...

    Class Err<E>

    A failed Result, with its error.

    import { Err } from "staquia";

    const result = new Err(new Error("Something failed"));
    console.log(result.ok, result.error.message); // false "Something failed"

    Type Parameters

    • E

      The type of the error.

    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Creates an instance of an Err result.

      Type Parameters

      • E

        The type of the error.

      Parameters

      • error: E

        The error payload to wrap.

      Returns Err<E>

    Accessors

    • get error(): E

      The error object or payload contained within this result.

      Returns E

    • get ok(): false

      Indicates that the result represents a failure.

      Returns false

    Methods

    • Returns a string representation of the contained error.

      Returns string