'Expected a step @ line 37, column 17. try{

i am trying to use try catch inside stage but getting error as mentioned in subject. Here i am using build job to call another jenkins pipeline which works without try-catch. Not sure if we can use try-catch outside shell with build job ?. \n \n Requirement is to use try catch with build job so that in case of any failure , it will skip this step, echo message and go to next step.

{
   stage('Pull Pipeline') {
        try {
            build job: "../new pipeline/test_dummy", wait: true
        }
        catch (Exception e) {
            echo "release having error"
        }       
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source