From c3f783fe04e89ed5ef7b4ed662409316b56c0b58 Mon Sep 17 00:00:00 2001 From: fbelzunc Date: Fri, 18 Dec 2015 11:50:46 +0100 Subject: [PATCH] catch CancellationException --- src/main/groovy/com/cloudbees/plugins/flow/FlowDSL.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/groovy/com/cloudbees/plugins/flow/FlowDSL.groovy b/src/main/groovy/com/cloudbees/plugins/flow/FlowDSL.groovy index 1ea35e4..bbced41 100644 --- a/src/main/groovy/com/cloudbees/plugins/flow/FlowDSL.groovy +++ b/src/main/groovy/com/cloudbees/plugins/flow/FlowDSL.groovy @@ -457,8 +457,12 @@ public class FlowDelegate { Result result = final_state.result results.add(final_state) current_state.result = current_state.result.combine(result) - } catch(ExecutionException e) - { + } catch(CancellationException e) { + // TODO perhaps rethrow? + current_state.result = FAILURE + listener.error("Failed to run DSL Script: At least one of the tasks of the buildflow was cancelled") + e.printStackTrace(listener.getLogger()) + } catch(ExecutionException e) { // TODO perhaps rethrow? current_state.result = FAILURE listener.error("Failed to run DSL Script")