<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You need to list all exception types that can be thrown. And when you call another throwing method without handling the exception, it needs to be listed as well. Which means that you can end up with a method that has a list of a dozen of exception names that can be thrown.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 27, 2016, at 11:56 AM, Derrick Ho via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">Daniel Leping, I am unfamiliar with java.  Do you have any resources that describe the nightmare in detail?<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Dec 27, 2016 at 2:50 AM Tino Heth &lt;<a href="mailto:2th@gmx.de" class="">2th@gmx.de</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">-1 for specifying errors for throws. Please don't. Proven by practice in java it's a nightmare.</span></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">In Java, this topic is really interesting:</div><div class="gmail_msg">It sounds like a great idea, but in real-life situations, afaics everyone hates checked exceptions.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">But Swift isn't Java, and our error handling is different from most established languages, so imho we shouldn't base that decision on experiences from other models only:</div><div class="gmail_msg">I don't see downsides, because you already need "try" for everything that can throw, and afaics, it would be easy to ignore the information that only a set of exceptions can happen in a given context.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So, imho before there is a decision wether "throws" should be moved, the possibility to annotate it with a fixed set of error types should be either abandoned or incorporated.&nbsp;</div></div></blockquote></div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>