I needed to know programmatically if last ran failed or not.

After some exploring, here's the code: