fromUnitTask

Namespace: FsToolkit.ErrorHandling

Transforms a Task into a Job<Result<unit, exn>>

Function Signature

Task -> Job<Result<unit, exn>>

Examples

Example 1

let result = JobResult.fromUnitTask (task { return () })
// job { return Ok () }

Example 2

let result = JobResult.fromUnitTask (task { return System.Exception("error") })
// job { return Error "error" }

Last updated