Netsniff.js example should exit with an error when fails to load the adress

Issue #11333 https://github.com/ariya/phantomjs/issues/11333
1.x
Alex Alvarez 2013-05-18 17:39:49 +03:00 committed by Ariya Hidayat
parent 2f851086e4
commit 3bd7a3dfa6
1 changed files with 2 additions and 1 deletions

View File

@ -129,6 +129,7 @@ if (system.args.length === 1) {
var har;
if (status !== 'success') {
console.log('FAIL to load the address');
phantom.exit(1);
} else {
page.endTime = new Date();
page.title = page.evaluate(function () {
@ -136,7 +137,7 @@ if (system.args.length === 1) {
});
har = createHAR(page.address, page.title, page.startTime, page.resources);
console.log(JSON.stringify(har, undefined, 4));
phantom.exit();
}
phantom.exit();
});
}