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

m
(Added Quackery.)
Line 857:
bazCallCount += 1
if bazCallCount == 1 {
throw "Err0"Error.BazCall1()
} else if bazCallCount == 2 {
throw "Err1"Error.BazCall2()
}
}
Line 873:
bar()
} catch {
UnexpectedErrorBazCall1("Err0") => print("Err0BazzCall1 caught.")
}
calls -= 1
}
}
 
foo()</lang>
 
{{out}}
 
<pre>Err0BazzCall1 caught.
Unhandled exception. Runtime exception Dy601: Err1BazCall2
Stack trace: ...</pre>
 
Anonymous user