[swift-users] Asynchronous error recovering with RecoverableError

Elia Cereda eliacereda at gmail.com
Fri Mar 3 14:33:11 CST 2017

I’m wondering why the resultHandler block on RecoverableError.attemptRecovery(optionIndex, resultHandler:) is not marked @escaping?

I’m trying to invoke some recovering code that executes asynchronously, then reports if it was successful or not and I thought that this was the right strategy. As far as I can tell, without @escaping that method loses all it’s purpose and becomes essentially equivalent to attemptRecovery(optionIndex:).

So, I’d like to ask.
1. Is it a bug or that method is non-escaping on purpose?
2. If it is a bug, is there a workaround that can be applied pending a fix in a future version of Swift?
3. If it was a deliberate decision, what's the supported method of asynchronously invoking error recovery code?

Seeing that this wasn’t changed in Xcode 8.3b2, I think it unlikely that this was an oversight.

Elia Cereda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170303/2ed0298f/attachment.html>

More information about the swift-users mailing list