---
title: "init(catching:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/result/init(catching:)"
---

# init(catching:)

Creates a new result by evaluating a throwing closure, capturing the returned value as a success, or any thrown error as a failure.

## Declaration

```swift
init(catching body: () throws(Failure) -> Success)
```

## Parameters

- `body`: A potentially throwing closure to evaluate.

## Mentioned in

Preserving the Results of a Throwing Expression

## See Also

### Converting a Throwing Expression to a Result

- [Preserving the Results of a Throwing Expression](swift/preserving-the-results-of-a-throwing-expression.md)
