> 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/asyncresult/transforms/ofasync.md).

# ofAsync

Namespace: `FsToolkit.ErrorHandling`

Transforms a `Async<'T>` into an `Async<Result<'T, 'Error>>`.

## Function Signature

```fsharp
Async<'T> -> Async<Result<'T, 'Error>>
```

## Examples

### Example 1

```fsharp
let result = AsyncResult.ofAsync (async { return 42 })
// async { return Ok 42 }
```
