I have a pipeline with some stages and logic. The only possible debugger is adding try-catch to each stage:
stage ("distribution"){
steps{
script{
try{
amd_distribution_distribute_bundle
}
catch (Exception e) {
echo e.toString()
}
}
}
}
however, if one stage fails, I need to stop the pipeline:
status = sh script: '''
set +x
python3.4 main.py --command create_bundle
''', returnStatus:true
}
}
}
if (status == 1) {
error("returning 1 from func")
}
but the try-catch from the pipeline actually cancel it (it proceed to other stages. is there a way to combine them?