-
Bug
-
Resolution: Unresolved
-
Major
-
None
If you have a stage which children it will always be reported as successful.
stage('Parent') { echo "Parent starting..." stage('Child 1') { echo 'Child 1' catchError(stageResult: FAILURE') { throw new Exception('Child 1 error') } } echo "Parent after child 1..." catchError(stageResult: FAILURE') { throw new Exception('Parent error') } }
In this example both 'Parent' and 'Child 1' stages should be marked as failed but instead 'Child 1' is correct marked as failed but 'Parent' is marked as successful.
stage('Parent') { echo "Parent starting..." catchError(stageResult: FAILURE') { throw new Exception('Parent error') } }
This example proves that the second catch error in the first example is capable of setting the 'Parent' to failure, it just doesn't do it if a child stage exists.