<div dir="ltr">Why are you even using throw and try-bang here? It looks like, instead of throw, you should be using preconditionFailure: “Use this function to stop the program when control flow can only reach the call if your API was improperly used.”<div><br><div><div><div><a href="https://developer.apple.com/library/ios/documentation/Swift/Reference/Swift_StandardLibrary_Functions/index.html#//apple_ref/swift/func/s:FSs19preconditionFailureFTKT_SS4fileVSs12StaticString4lineSu_T_">https://developer.apple.com/library/ios/documentation/Swift/Reference/Swift_StandardLibrary_Functions/index.html#//apple_ref/swift/func/s:FSs19preconditionFailureFTKT_SS4fileVSs12StaticString4lineSu_T_</a><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 4:33 PM, Don Wills via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div><font face="Courier New"><b>func add(p1: String, _ p2 Any) {</b></font></div><div><font face="Courier New"><b>    try! addWithThrows(p1, p2)</b></font></div><div><font face="Courier New"><b>}</b></font></div><div><font face="Courier New"><b><br></b></font></div><div><font face="Courier New"><b>private func addWithThrows(p1: String, _ p2 Any) throws {</b></font></div><div><font face="Courier New"><b>    // code that handles many types for p2, followed by return for each of the valid types</b></font></div><div><font face="Courier New"><b>    throw Exception(&quot;Invalid type&quot;)  /* for those types not supported which is a programmer error */</b></font></div><div><font face="Courier New"><b>}</b></font></div><div><br></div></div></blockquote></div></div></div></div></div></div>