3 ms·
Here’s your explanation: https://github.com/apple/swift/blob/master/docs/ErrorHandlingRationale.rst https://github.com/apple/swift/blob/master/docs/ErrorHandlin
by joewillsher 10y ago
Here’s your explanation: https://github.com/apple/swift/blob/master/docs/ErrorHandlingRationale.rst https://github.com/apple/swift/blob/master/docs/ErrorHandlin...
There has been discussion about statically typed errors on the evolution mailing list — some core team members said they may look into in the future and others seeming more doubtful of its usefulness.
Why do you think a typed error handling model is better than introspecting the error at the catch site, I’m not sure I buy it?
- chris_7 10y agoErrors should be Just Another Value, so the difference between untyped errors and typed errors is the same as the difference between just using Any for every parameter and return value, and using actual types. You can use Any for everything, and it can even be totally safe if you use as? correctly, but it's obvious why no one does that. It's not obvious to me why people are fine with that situation for errors - again, the catch-all handler issue mentioned above, and the bizarre special-casing of NSError.