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

catchError does not mark a stage as failed

    Details

    • Similar Issues:

      Description

      This may be a case outlined by the release notes for JENKINS-52114 but definitely caught me by surprise. Since catchError still marks the build as failed (as expected), I would expect the stage to be considered failed as well.

       

      pipeline {
        agent none
        options { skipDefaultCheckout() }
        stages {
          stage('catchError') {
            steps {
              catchError {
                error 'Force error'
              }
              echo 'This echo still runs'
            }   
            post {
              success { echo 'Post success will still run' }
              failure { echo 'I will not run!' }
            }   
          }   
        }
      } 

      I suspect this is a root cause for JENKINS-52005 as well.

        Attachments

          Activity

          Hide
          a397705152 shen xuebing added a comment -

          I also need to set a stage to fail and continue the next stage of the method.

          Show
          a397705152 shen xuebing added a comment - I also need to set a stage to fail and continue the next stage of the method.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              rpocase Robby Pocase
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: