Error handling in Swift <p>Below is some code I wrote:</p> <pre><code>func Begin(input: String) -&gt; Double { let inputs = (input as NSString).lowercaseString var smth = AnalyzeInput(input: inputs) return smth.findOutput() } </code></pre> <p>Line 3 of this code (the 'smth' declaration) begins a long series of code that, at many instances, may throw some kind of an error (typically an index out of bounds error when creating a substring). Because this code is about 5,000 lines in 15 different files, and manually handling each exception would take a long time for each one, I would greatly prefer to not have to manually handle these exceptions.</p> <p>I understand that there is no try / catch / finally structure in Swift, but is there anything where I can mimic that functionality? Or did I just dig myself into a giant hole?</p>