<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/nserrorrecoveryattempting",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "NSErrorRecoveryAttempting"
}
-->

# NSErrorRecoveryAttempting

A set of methods that provide options to recover from an error.

## Discussion

The `NSErrorRecoveryAttempting` informal protocol provides methods that allow your application to attempt to recover from an error. These methods are invoked when an `NSError` object is returned that specifies the implementing object as the error `recoveryAttempter` and the user has selected one of the error’s localized recovery options. The method invoked depends on how the error is presented to the user. If the error is presented in a document-modal sheet, <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/attemptRecovery(fromError:optionIndex:delegate:didRecoverSelector:contextInfo:)> is invoked. If the error is presented in an application-modal dialog, <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/attemptRecovery(fromError:optionIndex:)> is invoked.

## Topics

### Attempting Recovery From Errors

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/attemptRecovery(fromError:optionIndex:delegate:didRecoverSelector:contextInfo:)>

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/attemptRecovery(fromError:optionIndex:)>



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)