title: Why Jenkins catchs a error of previous failed stage in success one
body: <p>I want the second stage executes failure block only if there is a error in the &quot;Success stage&quot;.
  Second stage always executes failure block even if there are no errors in the stage but in previous one.
  Try to add after first failure but no success.</p>
  <pre><code>    script {
  currentBuild.result = &quot;SUCCESS&quot;}
  </code></pre>
  <p>My pipline</p>
  <pre><code>pipeline {
  agent {
      label 'slave'
  }
  stages {    
      stage('Failed stage') {
          steps {
              catchError {
                  sh &quot;exit 1&quot;
              }                  
          }
          post {
              failure {
                  timeout(time: 240, unit: 'MINUTES') {
                      input(id: &quot;Build Gate 1&quot;, message: &quot;Proceed or Abort?&quot;)
                  }
                 //script {
                 //     currentBuild.result = &quot;SUCCESS&quot;
                 //}
              }
          }             
      }        
      stage('Success stage') {
          steps {
              catchError {
                  sh &quot;exit 0&quot;
              }                  
          }
          post {
              failure {
                  timeout(time: 240, unit: 'MINUTES') {
                      input(id: &quot;Build Gate 2&quot;, message: &quot;Proceed or Abort?&quot;)
                  }
              }
          }             
      } 
  </code></pre>
  <p>}</p>