Added an extension to actions that allows for cleanup before bubbling an exception that occurs.