I am currently integrating automatic builds of pull requests. I have the following stages for CI:
1) Initialize
2) Build
3) Test
4) Finalize
My idea is to update the github status in the Initialize stage. In the Finalize stage I set the status to succes. This all works great. However, I also want to set the state to error when *any* of the stages fail. For example, unit tests fail. I don't want to add a try/catch around all the stages (some CI builds have even more stages).
I want the same thing that is available in FinalBuilder, an OnError stage which runs when any error occurs.