I have a scripted jenkins pipeline with the code like this.
value=true
fun_stage_1()
println +value
def func_stage_1() {
try {
stage1{
stage1 steps
}
}
catch {
value=false
return value
}
}
Here I am expecting the value to be false in case of issues after calling the function , But it comes true. What I am doing wrong here?