Trigger phantomasFailure event when errors are thrown

This exposes the error message, as well as allowing us to act when there are errors.