Skip to content

Commit 419586b

Browse files
committed
[SE-0112] Rename attemptRecovery(optionIndex:andThen:) to attemptRecovery(optionIndex:resultHandler:).
1 parent b86b812 commit 419586b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stdlib/public/SDK/Foundation/NSError.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ public protocol RecoverableError : ErrorProtocol {
8585
var recoveryOptions: [String] { get }
8686

8787
/// Attempt to recover from this error when the user selected the
88-
/// option at the given index. This routine must call resultHandler and
88+
/// option at the given index. This routine must call handler and
8989
/// indicate whether recovery was successful (or not).
9090
///
9191
/// This entry point is used for recovery of errors handled at a
9292
/// "document" granularity, that do not affect the entire
9393
/// application.
9494
func attemptRecovery(optionIndex recoveryOptionIndex: Int,
95-
andThen resultHandler: (recovered: Bool) -> Void)
95+
resultHandler handler: (recovered: Bool) -> Void)
9696

9797
/// Attempt to recover from this error when the user selected the
9898
/// option at the given index. Returns true to indicate
@@ -106,11 +106,12 @@ public protocol RecoverableError : ErrorProtocol {
106106
}
107107

108108
public extension RecoverableError {
109-
/// By default, implements document-modal recovery via application-model
110-
/// recovery.
109+
/// Default implementation that uses the application-model recovery
110+
/// mechanism (``attemptRecovery(optionIndex:)``) to implement
111+
/// document-modal recovery.
111112
func attemptRecovery(optionIndex recoveryOptionIndex: Int,
112-
andThen resultHandler: (recovered: Bool) -> Void) {
113-
resultHandler(recovered: attemptRecovery(optionIndex: recoveryOptionIndex))
113+
resultHandler handler: (recovered: Bool) -> Void) {
114+
handler(recovered: attemptRecovery(optionIndex: recoveryOptionIndex))
114115
}
115116
}
116117

0 commit comments

Comments
 (0)