Catch canceled step and mark build has failure
When using the Parameterized plugin, the triggered job can be canceled. That causes an AbortException to be thrown. Since it is not handled, PostBuildScript let it through and the build is marked in failure even when one explicitly asks to ignore any error.
Catch AbortException and mark the build has being in failure in such a case instead of bubbling up the exception.
Fixes: https://phabricator.wikimedia.org/T352319
Before submitting a pull request, please make sure the following is done:
- Fork the repository and create your branch from
master. - If you've fixed a bug or added code that should be tested, please add JUnit tests.
- Ensure the test suite passes (
mvn clean verify). - Run
mvn hpi:runand go to http://localhost:8080/jenkins/ to test your changes. Add a job that produces your bug / feature scenario.
I am in the process of writing a test to cover this and will update the PR once I have finished.
Thanks for the contribution, @hashar ! Sorry, that I didn't react earlier. I somehow must have overseen it.
@dheid no worries and thank you for the review, merge and release!
I found another issue which this times lie in the parameterized plugin :-]