Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 446 Bytes

File metadata and controls

22 lines (14 loc) · 446 Bytes

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)