def 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)