setMessage

Last modified: 12 June 2025
var result = _exceptions.tryCatch {
    tryRunning {
        _console.log("tryRunning执行了1")
        _exceptions.throwException { setMessage("xxx") }
        _console.log("不会执行到这里")
        "没有异常"
    }
    catchException {
        _console.log("catchException执行了")
        "出现异常" + it.getMessage()
    }
    finallyRun { _console.log("finally run 1...") }
}
_console.log("result", result)
result = _exceptions.tryCatch {
    tryRunning {
        _console.log("tryRunning执行了2")
        "没有异常"
    }
    catchException {
        _console.log("不会执行到这里")
        "出现异常" + it.getMessage()
    }
    finallyRun { _console.log("finally run 2...") }
}
_console.log("result", result)

tip