<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Well … obviously. It’s a toy example. The point was the nested conditionals, not the method.</div><div class=""><br class=""></div><div class="">P</div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 23, 2015, at 12:12 AM, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""></div><div class=""> I find it a little bit strange that your error handling function takes an optional in the first place.</div><div class="">The caller should only call an errror handler in case of an error, so you should <span style="background-color: rgba(255, 255, 255, 0);" class="">already </span>have unwrapped the optional. </div><div class=""><br class=""></div><div class="">-Thorsten </div><div class=""><br class="">Am 22.12.2015 um 18:30 schrieb Paul Cantrell via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:<br class=""><br class=""></div><blockquote type="cite" class=""><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">func</span> handleFileNotFound(error: <span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">ErrorType</span>?)</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">if</span> <span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">let</span> error = error</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> {</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> <span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">if</span> <span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">case</span> MyError.FileNotFound(<span style="font-variant-ligatures: no-common-ligatures; color: #323e7d" class="">let</span> url) = error</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> { <span style="font-variant-ligatures: no-common-ligatures; color: #587ea8" class="">print</span>(url) }</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> }</div><div style="margin: 0px; font-size: 10.5px; line-height: normal; font-family: Menlo;" class=""> }</div></blockquote></div></div></blockquote></div><br class=""></body></html>