Re: [swift-evolution] A unified error handling mechanism?

2016-08-06 Thread Jose Cheyo Jimenez via swift-evolution
Hi Fernando, Some projects use a result type to unify the error handling. https://github.com/antitypical/Result There has been discussions about this and Chris L thinks that we may get a native (constrained) result type at some point.

Re: [swift-evolution] A unified error handling mechanism?

2016-08-06 Thread Xiaodi Wu via swift-evolution
Fernando, the rationale behind the design of error handling in Swift is detailed here: https://github.com/apple/swift/blob/master/docs/ErrorHandlingRationale.rst Some of that document may now be out-of-date, but you may find it to be helpful nonetheless. On Sat, Aug 6, 2016 at 10:40 AM, Anton

Re: [swift-evolution] A unified error handling mechanism?

2016-08-06 Thread Anton Zhilin via swift-evolution
2016-08-06 2:50 GMT+03:00 Fernando Rodríguez : b) do/try/catch > > This allows you to have information about the error, but also causes the > newly created object to be "trapped" inside a do block. > > Are there any plans to address this situation? I believe there

Re: [swift-evolution] A unified error handling mechanism?

2016-08-05 Thread Anders Ha via swift-evolution
> On 6 Aug 2016, at 7:50 AM, Fernando Rodríguez via swift-evolution > wrote: > > Hi, > > I do a lot of training and one of the features of Swift that seems more > confusing to students (and myself) is error handling. There are too many ways > of doing it, and none

Re: [swift-evolution] A unified error handling mechanism?

2016-08-05 Thread Boris Wang via swift-evolution
do/try/catch use the error handling mechanism, named exception. I think we should use it carefully , it will results convoluted code and the risk of exception safe. Fernando Rodríguez 于2016年8月6日 周六07:50写道: > Hi, > > I do a lot of training and one of the features of

[swift-evolution] A unified error handling mechanism?

2016-08-05 Thread Fernando Rodríguez via swift-evolution
Hi, I do a lot of training and one of the features of Swift that seems more confusing to students (and myself) is error handling. There are too many ways of doing it, and none seems satisfactory. Let's take for example an initializer. There are 2 different ways of handling errors within an init: