---
title: "attemptRecovery(optionIndex:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/recoverableerror/attemptrecovery(optionindex:)"
---

# attemptRecovery(optionIndex:)

Attempt to recover from this error when the user selected the option at the given index. Returns true to indicate successful recovery, and false otherwise.

## Declaration

```swift
func attemptRecovery(optionIndex recoveryOptionIndex: Int) -> Bool
```

## Discussion

Discussion This entry point is used for recovery of errors handled at the “application” granularity, where nothing else in the application can proceed until the attempted error recovery completes.
