> For the complete documentation index, see [llms.txt](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/taskresult/maperror.md).

# mapError

### TaskResult.mapError

Namespace: `FsToolkit.ErrorHandling`

Function Signature:

```fsharp
('a -> 'b) -> Task<Result<'c, 'a>> -> Task<Result<'c, 'b>>
```

### Examples

#### Example 1

From the [TaskResult.map](broken://pages/-Le0P1s6TqyQ-PMbDcQ-#example-1) example, if we want to map the error part alone, we can do it as below:

```fsharp
// Task<Result<PostId>, string>
createPost createPostRequest
|> TaskResult.mapError (fun (ex : exn) -> ex.Message)
```
