@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function Err

    • Creates a failed Result containing an error.

      Type Parameters

      • E

      Parameters

      • error: E

        The error to wrap in an Err.

      Returns Result<never, E>

      A Result of type Err<E>.

      const result = Err("Something went wrong");
      if (!result.ok) {
      console.error(result.error); // "Something went wrong"
      }