Evercatch - v0.8.0
    Preparing search index...

    Function err

    • Creates an error result with the given error.

      Type Parameters

      • E = Error

        The type of the error.

      Parameters

      • Optionalerror: E

        The error to wrap in an error result. Defaults to a new Error if not provided.

      Returns ResultErr<E>

      A ResultErr containing the error.

      const [error, value] = err(new Error("Oops")); // [Error: Oops, null]
      
      const [error, value] = err(); // [Error, null]