You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.
I don't really know the original reasons why you did write the statusCode=200 directly because PhantomJS drop the connections. I don't know that behavior but tried to fix as best as I can so that it is easier to debug.
I've delayed a bit this "direct writing" with a useful comment:
// This has been delayed a bit on purpose because once you write the http status code,
// you can't change it in case of error :(
// So we only start writing after 500ms so that the page.open has a time window
// to eventually trigger an error with the appropriate status code
window.setTimeout(function () {
// must start the response now, or phantom closes the connection
if ( pageOpenCallbackFired ) {
response.statusCode = 200;
response.write('');
}
},500);
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When PhantomJS fails to download the web page (
page.open
), it actually returns a status code of 200 + a failure message in the body.The PhantomJS service should rather return an error code 502 Bad Gateway. So that the screenshot serving service can display a better error message.
The
page.open
error message can be accessed by the page API: check http://newspaint.wordpress.com/2013/04/25/getting-to-the-bottom-of-why-a-phantomjs-page-load-fails/The text was updated successfully, but these errors were encountered: