mirror of https://github.com/vitalif/phantomjs
Netsniff.js example should exit with an error when fails to load the adress
Issue #11333 https://github.com/ariya/phantomjs/issues/113331.9
parent
08cf5bb4e2
commit
2c2d020891
|
@ -129,6 +129,7 @@ if (system.args.length === 1) {
|
||||||
var har;
|
var har;
|
||||||
if (status !== 'success') {
|
if (status !== 'success') {
|
||||||
console.log('FAIL to load the address');
|
console.log('FAIL to load the address');
|
||||||
|
phantom.exit(1);
|
||||||
} else {
|
} else {
|
||||||
page.endTime = new Date();
|
page.endTime = new Date();
|
||||||
page.title = page.evaluate(function () {
|
page.title = page.evaluate(function () {
|
||||||
|
@ -136,7 +137,7 @@ if (system.args.length === 1) {
|
||||||
});
|
});
|
||||||
har = createHAR(page.address, page.title, page.startTime, page.resources);
|
har = createHAR(page.address, page.title, page.startTime, page.resources);
|
||||||
console.log(JSON.stringify(har, undefined, 4));
|
console.log(JSON.stringify(har, undefined, 4));
|
||||||
|
phantom.exit();
|
||||||
}
|
}
|
||||||
phantom.exit();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue