Last active
August 29, 2015 14:19
-
-
Save knownasilya/2e0240c6cfa051176c3a to your computer and use it in GitHub Desktop.
phantom errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page.onResourceError = function(resourceError) { | |
page.reason = resourceError.errorString; | |
page.reasonUrl = resourceError.url; | |
}; | |
page.open(url, function (status) { | |
status = status.replace('phantom says: ', ''); | |
if (status !== 'success') { | |
page.close(); | |
console.log(status + ' (' + page.reasonUrl + '): ' + page.reason); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment