# Function mapErr

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

- mapErr<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>

  Transforms the error value of a Result using the provided function.

  #### Type Parameters

  - T

    The success value type

  - E

    The original error value type

  - F

    The transformed error value type

  #### Parameters

  - result: Result<T, E>

    The Result to transform

  - fn: (error: E) => F

    The transformation function

  #### Returns Result<T, F>

  A new Result with the transformed error

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