init(catching:)
Creates a new result by evaluating an async throwing closure, capturing the returned value as a success, or any thrown error as a failure.
Declaration
nonisolated(nonsending) init(catching body: nonisolated(nonsending) () async throws(Failure) -> Success) asyncParameters
- body:
A potentially throwing async closure to evaluate.