异常捕捉

fun test() {
    val result = try {
        count()
    } catch (e: ArithmeticException) {
        throw IllegalStateException(e)
    }
    // 处理结果
}

results matching ""

    No results matching ""