From 3f9337752fab8b70ef1220a548aa6c02dcffe77f Mon Sep 17 00:00:00 2001 From: Dominik Chilla Date: Sat, 11 Jul 2020 23:44:00 +0200 Subject: [PATCH] exception handling Take 2 --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2e4df2c..0774478 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,6 +7,7 @@ pipeline { stage('Approve'){ steps { script { + import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException def userInput try { timeout(time: 5, unit: 'SECONDS') { @@ -17,10 +18,10 @@ pipeline { name: 'Please confirm you agree with this' ]]) } - } catch(FlowInterruptedException) { + } catch(FlowInterruptedException e) { echo "This job timed out" } catch(err) { // input false - echo "This Job has been Aborted" + echo "This job has been aborted" } if (userInput == true) { // do something