LNX-453:- Prevent Jenkins build from failing when execute shell step fails (#13300)

This commit is contained in:
Kapil Khandelwal 2023-01-20 00:24:58 +05:30 committed by GitHub
parent 58069ea225
commit 1b25127d89
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
pipeline {
agent any
stages {
stage('tryCatch') {
steps {
script {
try {
sh 'test_script.sh'
} catch (e) {
echo "An error occurred: ${e}"
}
}
}
}
}
}