I was going through Cloudbees Training Documentation for jenkins certification. In one of the section for Post it's mentioned that
An error in a post section does not make the Pipeline run unsuccessful
As I was unsure of this, I tried to create a simple pipeline and making it fail in Post section but as I was expecting it made the pipeline failed in red.
pipeline {
agent any
stages {
stage('Build') {
steps {
// Get some code from a GitHub repository
git 'https://github.com/jglick/simple-maven-project-with-tests.git'
}
}
}
post {
success {
error("Build failed because of this and that..")
}
}
}
Am I missing something in that statement or statement itself is wrong?

