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

# attemptRecovery(optionIndex:resultHandler:)

Attempt to recover from this error when the user selected the option at the given index. This routine must call handler and indicate whether recovery was successful (or not).

## Declaration

```swift
func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: @escaping (Bool) -> Void)
```

## Discussion

Discussion This entry point is used for recovery of errors handled at a “document” granularity, that do not affect the entire application.
