[swift-evolution] Amendment to SE-0112: Default values for errorDomain and errorCode

Tino Heth 2th at gmx.de
Thu Sep 8 05:46:01 CDT 2016


> Domain, code, and user-info are useful for Cocoa interoperability but aren’t otherwise necessary in Swift, which captures that information more directly in the (concrete) error types that conform to Error.
So the only motivation to hide _code and _domain is to discourage Objective-C-like dispatching in Swift, right?
For me, that would not be enough motivation to require something like "CustomNSError", but probably this isn't the opinion of the majority.

I still think Error should be a legacy-type that is only needed for interoperability… but removing the restriction that only Error-types can be thrown is additive, so I won't continue discussing this now.

- Tino


More information about the swift-evolution mailing list