mapError

TaskResult.mapError

Namespace: FsToolkit.ErrorHandling
Function Signature:
('a -> 'b) -> Task<Result<'c, 'a>> -> Task<Result<'c, 'b>>

Examples

Example 1

From the TaskResult.map example, if we want to map the error part alone, we can do it as below:
// Task<Result<PostId>, string>
createPost createPostRequest
|> TaskResult.mapError (fun (ex : exn) -> ex.Message)
Last modified 1yr ago