nexus-agents - v2.80.0
    Preparing search index...

    Function err

    Core exports - Types, Result<T,E>, errors, and logger Split from index.ts for file size compliance (Issue #285)

    • Creates a failed Result containing the given error.

      Type Parameters

      • E

        The error value type

      Parameters

      • error: E

        The error value

      Returns Result<never, E>

      A Result in the Err state

      const result = err(new Error('not found'));
      if (!result.ok) {
      console.error(result.error.message); // "not found"
      }