fun methodWithException() { try { throw Exception("test exception") } catch (e: Exception) { //实现任意部分处理, //并把错误传给调用方代码 throw e }}try { methodWithException()}catch (e: Exception) { println(e.message);}