# Function err

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

- err<E>(error: E): Result<never, E>

  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

  #### Example

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

  - Defined in packages/nexus-agents/src/core/result.ts:49