Unified error reporting in phantomjs.