onResourceError
Introduced: PhantomJS 1.9
This callback is invoked when a web page was unable to load resource. The only argument to the callback is the resourceError
metadata object.
The resourceError
metadata object contains these properties:
id
: the number of the requesturl
: the resource urlerrorCode
: the error codeerrorString
: the error description
Examples
var webPage = require('webpage');
var page = webPage.create();
page.onResourceError = function(resourceError) {
console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.url + ')');
console.log('Error code: ' + resourceError.errorCode + '. Description: ' + resourceError.errorString);
};