catchError should set result to STABLE if otherwise null

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

XMLWordPrintable

      Mailer doesn't send "back to normal" email, when pipeline gets green after failed build.
      The "failed build" email is send properly.

      The issue occurs only if plugin is used inside pipeline script.

      Example to reproduce:

      node {
          catchError {
            stage "random fail"
            Random random = new Random();
            int randomNumber = random.nextInt(10 - 1) + 1;
            echo "${randomNumber}"
            if (randomNumber > 5) {
              echo "in loop"
              currentBuild.result = 'FAILURE'
              error "failed"
            }
          }
          echo "after finally"
          step([$class: 'Mailer', recipients: 'tomasz.pietrek@sap.com'])    
      }
      

      The same issue occurs if code is wrapped with try, catch, finally instead of catchError

            Assignee:
            Unassigned
            Reporter:
            Tomasz Pietrek
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: