Files
kotlin-fork/backend.native/tests/runtime/exceptions/catch2.kt
T
2017-10-20 18:25:05 +03:00

24 lines
447 B
Kotlin

package runtime.exceptions.catch2
import kotlin.test.*
@Test fun runTest() {
try {
println("Before")
foo()
println("After")
} catch (e: Exception) {
println("Caught Exception")
} catch (e: Error) {
println("Caught Error")
} catch (e: Throwable) {
println("Caught Throwable")
}
println("Done")
}
fun foo() {
throw Error("Error happens")
println("After in foo()")
}