> 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.jobresult/jobresult/fromtask.md).

# fromTask

Namespace: `FsToolkit.ErrorHandling`

Transforms a `Task<'T>` into a `Job<Result<'T, Exception>>`

## Function Signature

```fsharp
Task<'T> -> Job<Result<'T, Exception>>
```

## Examples

### Example 1

```fsharp
let result = JobResult.fromTask (task { return 42 })
// job { return Ok 42 }
```

### Example 2

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