catchError does not mark a stage as failed

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Unassigned
            Reporter:
            Robby Pocase
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: