Catching an exception when loading a groovy file
问题 I have these 3 groovy files: A.groovy: // ... stage("Test") { throw new Exception("This script fails") } B.groovy: // ... stage("Test") { // Nothing, want this to pass } main.groovy: // ... m = [:] status = [:] scripts = ["A", "B"] for script in scripts { m["${script}"] = { stage("${script}") { try { load "${script}.groovy" status["${script}"] = true } catch (Exception e) { status["${script}"] = false } } } } parallel m for result_iterator in status: print "${result_iterator.key} resulted in