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

catchError block continues pipeline when aborted when catchInterruptions is set to false

XMLWordPrintable

      Description of my pipeline

      I have a pipeline with 2 stages, the 1st stage executes some tasks and the 2nd stage sends a bunch of Slack messages that are dependant on the outcome and the data produced from the 1st stage. I am using a "catchError()" block for my first stage as I don't care if this stage passes or fails, I want to send the Slack messages to say "the 1st stage passed" or the "the 1st stage failed" (this is oversimplified a bit but still shows the basics of my issue).

      My problem

      I have a pipeline with 2 stages, the 1st stage executes some tasks and the 2nd stage sends a bunch of Slack messages that are dependant on the outcome and the data produced from the 1st stage. I am using a "catchError()" block for my first stage as I don't care if this stage passes or fails, I want to send the Slack messages to say "the 1st stage passed" or the "the 1st stage failed" (this is oversimplified a bit but still shows the basics of my issue).

      When I ABORT my job, the "catchError()" does what it should and continues the job and sends the slack messages, but if I ABORT the build I DO NOT want to send these Slack messages. I thought I could use the "catchInterruptions" option and set it to false. The documentation for this option is: (here is the docs page)

      "If true, certain types of exceptions that are used to interrupt the flow of execution for Pipelines will be caught and handled by the step. If false, those types of exceptions will be caught and immediately rethrown. Examples of these types of exceptions include those thrown when a build is manually aborted through the UI and those thrown by theĀ timeout step. Defaults to true."

      The bug

      Either I am understanding this incorrectly, or the "catchInterruptions" option is not actually doing anything and is not working as it should

            Unassigned Unassigned
            wmoorby Will Moorby
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: