[swift-evolution] [Pitch] Typed throws
Russ Bishop
xenadu at gmail.com
Tue Feb 21 01:10:20 CST 2017
> On Feb 19, 2017, at 12:04 PM, Anton Zhilin via swift-evolution <swift-evolution at swift.org> wrote:
>
> It’s expected that if you need resilience, then you will throw an “open” enum. Essentially, we pass resilience of typed throws on to those who will hopefully establish resilience of enums.
>
You’ve just re-invented the error handling model we have today.
> If you prefer separate error types, then declare a base protocol for all your error types and throw a protocol existential.
>
And now we’ve re-invented Java’s checked exceptions “throws Exception”.
To what end?
Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170220/04e9a507/attachment.html>
More information about the swift-evolution
mailing list