In the AfterAction event of some actions of interest I write the ActionResult out to a database for nightly build reports.
For most actions this works perfectly well, except for RunActionList. Here, the AfterAction event is called while the ActionList is still running, and it always reports success.
Is there any way I can pick up failure of an ActionList (meaning an action inside the list failed) in the AfterAction event?
This is an unfortunate side effect of how action lists work… basically the actionlist’s first runnable action is pushed onto a stack and thus becomes the next action to execute… the side effect is that the run actionlist action actually completes before the actionlist starts.
The work around to this is to wrap the Run ActionList action inside a Try Catch block (right click on it and select the Refactoring menu). If the Run ActionList action fails the Catch block will be executed.