-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: core
-
Environment:2.426.3 and 2.440.1
pipeline {
  agent {
    node
  }
 stages {
  stage("test") {
    steps {
      catchError(buildResult:"FAILURE",stageResult:"FAILURE")
    }
    post {
      failure {
        println "${env.STAGE_NAME} failed"
      }
    }
  }
  stage("test2") {
    steps
    post {
      failure {
        println "${env.STAGE_NAME} failed"
      }
      success {
        println "${env.STAGE_NAME} passed"
      }
    }
  }
 }   Â
}
Â
I expect that the post for stage2 would execute the success block, but instead it executes the failure block.