diff --git a/Jenkinsfile b/Jenkinsfile index 83888be..e36bc4b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,19 +8,21 @@ pipeline { steps { script { def userInput - try { - timeout(time: 5, unit: 'SECONDS') { - userInput = input(id: 'Proceed1', message: 'Was this successful?', parameters: [[ - $class: 'BooleanParameterDefinition', - defaultValue: true, - description: '', - name: 'Please confirm you agree with this' - ]]) + catchError(buildResult: 'SUCCESS', stageResult: 'ABORTED') { + try { + timeout(time: 15, unit: 'SECONDS') { + userInput = input(id: 'Proceed1', message: 'Was this successful?', parameters: [[ + $class: 'BooleanParameterDefinition', + defaultValue: true, + description: '', + name: 'Please confirm you agree with this' + ]]) + } + } catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) { + error "Caught ${e.toString()}" + } catch(err) { // input false + echo "This job has been aborted" } - } catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedExceptionedException e) { - echo "This job timed out" - } catch(err) { // input false - echo "This job has been aborted" } if (userInput == true) { // do something