I get error code #1 when rendering some web pages but not others in phantomJS. The block is in a 3rd party module that calls phantomJS to take the screenshot.
if (path) {
phantomProc.on('exit', function(code) {
if (!calledCallback) {
calledCallback = true;
// No need to run the timeout anymore.
clearTimeout(timeoutID);
cb(code
? new Error('PhantomJS exited with return value ' + code)
: null);
}
});
What is error code 1? I can't find any reference to phantomJS error codes online.
I get error code #1 when rendering some web pages but not others in phantomJS. The block is in a 3rd party module that calls phantomJS to take the screenshot.
if (path) {
phantomProc.on('exit', function(code) {
if (!calledCallback) {
calledCallback = true;
// No need to run the timeout anymore.
clearTimeout(timeoutID);
cb(code
? new Error('PhantomJS exited with return value ' + code)
: null);
}
});
What is error code 1? I can't find any reference to phantomJS error codes online.
Share Improve this question asked Nov 15, 2013 at 15:05 metalaureatemetalaureate 7,74211 gold badges59 silver badges97 bronze badges 2- ` var phantomProc = childProcess.spawn(options.phantomPath, phantomArgs);` It's just a call to the phantomjs child process. – metalaureate Commented Nov 15, 2013 at 15:13
- It could be Invalid Function. – Anto Jurković Commented Nov 15, 2013 at 15:26
1 Answer
Reset to default 4code
is the return code the script execution.
This is generally manage inside the client script, by calling phantom.exit(code)
.
The convention on phantomjs examples, is to use 1
for invalid parameters.
For example, check the loadspeed.js
if (system.args.length === 1) {
console.log('Usage: loadspeed.js <some URL>');
phantom.exit(1);
} else {
...
}