Files
kotlin-fork/backend.native/tests/runtime/exceptions/catch7.kt
T
Svyatoslav Scherbina e2dbeae85e backend: add tests for try-catch-finally and throwing exceptions
also add some tests for bugs with unreachable code handling and variables
2016-11-28 20:24:27 +07:00

14 lines
243 B
Kotlin

fun main(args : Array<String>) {
try {
foo()
} catch (e: Throwable) {
val message = e.message
if (message != null) {
println(message)
}
}
}
fun foo() {
throw Error("Error happens")
}