Exceptions/Catch an exception thrown in a nested call: Difference between revisions
Content added Content deleted
(Added Kotlin) |
|||
Line 1,628: | Line 1,628: | ||
<lang scala>// version 1.0.6 |
<lang scala>// version 1.0.6 |
||
class U0 : Throwable("U0 occurred") |
class U0 : Throwable("U0 occurred") |
||
class U1 : Throwable("U1 occurred") |
class U1 : Throwable("U1 occurred") |
||
fun foo() { |
fun foo() { |
||
for (i in 1..2) |
for (i in 1..2) { |
||
try { |
try { |
||
bar(i) |
bar(i) |
||
} |
} catch(e: U0) { |
||
catch(e: U0) { |
|||
println(e.message) |
println(e.message) |
||
} |
} |
||
} |
|||
} |
} |
||