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