Exceptions/Catch an exception thrown in a nested call: Difference between revisions

Line 857:
bazCallCount += 1
if bazCallCount == 1 {
throw Error.@BazCall1()
} else if bazCallCount == 2 {
throw Error.@BazCall2()
}
}
Line 873:
bar()
} catch {
@BazCall1() => print("BazzCall1 caught.")
}
calls -= 1
Line 884:
 
<pre>BazzCall1 caught.
BazCall2
Unhandled exception. Runtime exception Dy601: BazCall2
Stack trace: ...</pre>
 
Anonymous user