[swift-evolution] [Proposal idea] Improved interop for ErrorType->NSError

Thorsten Seitz tseitz42 at icloud.com
Wed Dec 23 00:12:19 CST 2015


 I find it a little bit strange that your error handling function takes an optional in the first place.
The caller should only call an errror handler in case of an error, so you should already have unwrapped the optional. 

-Thorsten 

> Am 22.12.2015 um 18:30 schrieb Paul Cantrell via swift-evolution <swift-evolution at swift.org>:
> 
> func handleFileNotFound(error: ErrorType?)
>         {
>         if let error = error
>             {
>             if case MyError.FileNotFound(let url) = error
>                 { print(url) }
>             }
>         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/2ffa022a/attachment.html>


More information about the swift-evolution mailing list