Documentation Index
Fetch the complete documentation index at: https://mintlify.com/supermacro/neverthrow/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Maps aResultAsync<T, E> to ResultAsync<T, F> by applying a function to the contained Err value. The Ok value is left untouched.
Signature
Function to transform the Err value. Can return either a value or a Promise.
ResultAsync<T, U> - A new ResultAsync with the transformed error
Usage
Convert error types
Async error mapping
Add context to errors
Key characteristics
- Short-circuits on Ok: If the ResultAsync is Ok, mapErr is not executed
- Type transformation: Allows changing the error type in the Result
- Async support: Can handle both sync and async error transformation functions
Related
map
Transform the Ok value
orElse
Recover from errors