Getting active exception in declaritive post failure routine

13 views
Skip to first unread message

Joshua Harlow

unread,
Jan 24, 2020, 10:07:55 PM1/24/20
to Jenkins Users
Hi all, I am trying to do some slack integration whereby in a declarative post failure section we want to send to slack the exception message that triggered the failure.

Something like:

pipeline {
   stages {
     ...
   }
   post {
      failure {
          slackSend(message: "Failed due to ${cause.toString()}")
      }
   }
}

What I am noticing is that it seems impossible to get the active exception/failure in a post section. Is there any trick that I am missing?

-Josh
Reply all
Reply to author
Forward
0 new messages