java-tutorials/jenkins-modules/jenkins-jobs/prevent-build-failure-job/pipeline-prevent-build-fail...

17 lines
342 B
Plaintext
Raw Normal View History

pipeline {
agent any
stages {
stage('tryCatch') {
steps {
script {
try {
sh 'test_script.sh'
} catch (e) {
echo "An error occurred: ${e}"
}
}
}
}
}
}