exception handling Take 2
This commit is contained in:
parent
9db0035eaa
commit
3f9337752f
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user