Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60239

Aborted catchError sets build result to ABORTED if fail fast is true

    Details

    • Similar Issues:

      Description

      Hello, 

      I have the following declarative pipeline:

      pipeline {
      	
          agent any
      
          options { 
              parallelsAlwaysFailFast() 
          }
          	
          stages {
              stage('A') {
                  parallel {
                      stage('A1') {
                          steps { 
                              error 'fail' 
                          }
                      }
                      
                      stage('A2') {
                          steps { 
                              script {
                                  catchError(stageResult: 'FAILURE') {
                                      println 'a2'
                                      sleep 10
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
      

      The result is ABORTED instead of FAILURE.
      I think that somehow aborting a stage that contains a catchError affects the build result.

      For me the expected result is FAILURE

        Attachments

          Activity

          Hide
          dnusbaum Devin Nusbaum added a comment -

          Did you try using catchError(catchInterruptions: false)?

          Show
          dnusbaum Devin Nusbaum added a comment - Did you try using catchError(catchInterruptions: false) ?
          Hide
          dpuiu Daniel Puiu added a comment -

          Hello Devin Nusbaum,
          I have tried it following your suggestion and it works.
          Thanks
          Best regards

          Show
          dpuiu Daniel Puiu added a comment - Hello Devin Nusbaum , I have tried it following your suggestion and it works. Thanks Best regards
          Hide
          dnusbaum Devin Nusbaum added a comment -

          Glad to hear it!

          Show
          dnusbaum Devin Nusbaum added a comment - Glad to hear it!

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              dpuiu Daniel Puiu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: