PhantomJS log
Verbose logging can be enabled for PhantomJS by setting the debug flag on the client. This is the same as setting the PhantomJS --debug=true
command line option.
The client log can be inspected after making a request.
Note
The client log contains some helpful information specific to the PhantomJS library. In some cases these are present in the log even if debugging is disabled.
Javascript console log
The response object also provides access to a console log. Any javascript errors raised on the requested page will be present in the response console log.
Validation errors
Before a script template is compiled and cached it is validated using the Esprima javascript validation engine. If the script fails to validate then a JonnyW\PhantomJs\Exception\SyntaxException
will be raised. Debug information about any validation errors can be found by calling a getErrors()
helper method on the exception instance. This will return an array of error information.
Important
Due to a limitation in the validation logic, scripts are currently minified to a single line before validating. This makes the
lineNumber
value contained in the error output redundant. This is due to be fixed in a future release.