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

catchError should give a visual hint in which stage the error occurred

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When using catchError in a stage and the steps in catchError fail, then no visual feedback on the pipeline view is given in which stage it failed. You have to click on each individual stage to find the bad one.

      It would be better if the stage would be rendered red as for normal failures

        Attachments

          Activity

          Hide
          rodrigc Craig Rodrigues added a comment - - edited

          I can reproduce this problem with this pipeline:

          pipeline {
              agent any
              
              stages {
                  stage("Remove file which does not exist") {
                      steps {
                         catchError {
                              sh("rm /nonexistent")
                          }
                      }
                  }
                  
                  stage("Hello!") {
                      steps {
                          sh("echo Hello1")
                      }
                  }
              }
          }
          

          The Remove file which does not exist node should be red, but it is green.

          Show
          rodrigc Craig Rodrigues added a comment - - edited I can reproduce this problem with this pipeline: pipeline { agent any stages { stage("Remove file which does not exist") { steps { catchError { sh("rm /nonexistent") } } } stage("Hello!") { steps { sh("echo Hello1") } } } } The Remove file which does not exist node should be red, but it is green.
          Hide
          alexandr_semak Alexandr Semak added a comment - - edited
          node {
              stage("successful"){
                  echo "successful stage"
              }
              stage("unstable"){
                  catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE'){
                      sh "gooo version"
                  }
              }
              stage("continue working"){
                  echo "continue working"
              }
          }
          

          I also have this is issue.
          Jenkins v2.164.3(Basic Steps 2.18) already installer doesn't work if I update Basic Steps but when I was testing on new spiup Jenkins with the same version 2.164.3 it is work

          Show
          alexandr_semak Alexandr Semak added a comment - - edited node { stage( "successful" ){ echo "successful stage" } stage( "unstable" ){ catchError(buildResult: 'SUCCESS' , stageResult: 'UNSTABLE' ){ sh "gooo version" } } stage( " continue working" ){ echo " continue working" } } I also have this is issue. Jenkins v2.164.3(Basic Steps 2.18) already installer doesn't work if I update Basic Steps but when I was testing on new spiup Jenkins with the same version 2.164.3 it is work
          Hide
          anupamaj83 Anupama Janakiram added a comment -

          having the same problem. Stage fails , but doesn't show up in OpenBlueOcean visualization.  Post stage action failure{} gets executed giving a hint that currentBuild.Result = FAILURE, but interestingly the following stages get executed while not expected to do so.

          Show
          anupamaj83 Anupama Janakiram added a comment - having the same problem. Stage fails , but doesn't show up in OpenBlueOcean visualization.  Post stage action failure{} gets executed giving a hint that currentBuild.Result = FAILURE, but interestingly the following stages get executed while not expected to do so.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            kutzi kutzi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: