Skip to content

RecoverableError's resultHandler needs @escaping #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public protocol RecoverableError : Error {
/// This entry point is used for recovery of errors handled at a
/// "document" granularity, that do not affect the entire
/// application.
func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: (_ recovered: Bool) -> Void)
func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: @escaping (_ recovered: Bool) -> Void)

/// Attempt to recover from this error when the user selected the
/// option at the given index. Returns true to indicate
Expand All @@ -256,7 +256,7 @@ public extension RecoverableError {
/// Default implementation that uses the application-model recovery
/// mechanism (``attemptRecovery(optionIndex:)``) to implement
/// document-modal recovery.
func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: (_ recovered: Bool) -> Void) {
func attemptRecovery(optionIndex recoveryOptionIndex: Int, resultHandler handler: @escaping (_ recovered: Bool) -> Void) {
handler(attemptRecovery(optionIndex: recoveryOptionIndex))
}
}
Expand Down