exception handling take 3
This commit is contained in:
parent
3f9337752f
commit
9941894a4f
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@ -7,7 +7,6 @@ pipeline {
|
|||||||
stage('Approve'){
|
stage('Approve'){
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException
|
|
||||||
def userInput
|
def userInput
|
||||||
try {
|
try {
|
||||||
timeout(time: 5, unit: 'SECONDS') {
|
timeout(time: 5, unit: 'SECONDS') {
|
||||||
@ -18,7 +17,7 @@ pipeline {
|
|||||||
name: 'Please confirm you agree with this'
|
name: 'Please confirm you agree with this'
|
||||||
]])
|
]])
|
||||||
}
|
}
|
||||||
} catch(FlowInterruptedException e) {
|
} catch(org.jenkinsci.plugins.workflow.steps.FlowInterruptedExceptionedException e) {
|
||||||
echo "This job timed out"
|
echo "This job timed out"
|
||||||
} catch(err) { // input false
|
} catch(err) { // input false
|
||||||
echo "This job has been aborted"
|
echo "This job has been aborted"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user