> On Feb 21, 2017, at 8:18 AM, Joe Groff <jgr...@apple.com> wrote:
>>> 
>> 
>> Yeah but Rust has a macro system so error-chain makes re-wrapping trivial. A 
>> simple `chain_err(|| “my new error message”)` is enough to define and 
>> “throw” a new error that wraps the underlying error.
> 
> That was my point—they recognized error chaining/layering as a common 
> phonemenon and provided affordances for it as part of their design. I was 
> saying we should do the same if we investigate typed errors seriously. (Not 
> sure why you mentioned macros—chain_err is just a regular method, and could 
> be defined as an extension method on Error in swift today.)
> 
> -Joe

Sorry, I meant error_chain! handles the boilerplate. At the end of the day 
something has to create the new error types.

I agree with you on the chaining; if we really do want to go down this road we 
need an elegant solution. Seeing people talk about getting rid of rethrows 
makes me think this isn’t yet a serious discussion.

Russ
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to