Answer the question
In order to leave comments, you need to log in
Jenkins. How to get value from ERROR?
Installed Jenkins 2.89.4 + Pipeline plugins Pipeline
code:
pipeline{
agent any
stages{
stage('INIT'){
steps{
script{
error 'My Error in Stage'
}
}
}
}
post{
success {
echo "post success"
}
failure{
echo "post failure"
}
}
}
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in d:\tmp\JenkinsWS\TEST
[Pipeline] {
[Pipeline] stage
[Pipeline] { (INIT)
[Pipeline] script
[Pipeline] {
[Pipeline] error
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] echo
post failure
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: My Error in Stage
Finished: FAILURE
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question