Jenkinsfile how to capture multiple exceptions in parallel branches

Viewed 1574

I have a jenkins script, which used by jenkins pipeline job:

 try{
     parallel branch1: {
          //some function that may throw exception
     }, branch2: {
          //some function that may throw exception
     }, branch3: {
          //some function that may throw exception
     }
 }catch(Exception e){
     //Need to gather the error information together.
     //if there is only 1 error then that's it; 
     //if there are 2 or more errors then concatenate them or so, etc.. and print it. 
 }

How can I get all the exceptions in these branches? or I just cannot do that?

1 Answers
Related