异常处理

//any method can throw an Exception
//In your own code, you can use Nothing to mark a function that never returns
fun methodWithException(): Nothing {
    throw Exception("test exception")
}

//any method can throw an RuntimeException
fun methodWithRuntimeException() {
    throw RuntimeException("test exception")
}