From 3bd7a3dfa67f9c145b7568748ba5eec22ca0095d Mon Sep 17 00:00:00 2001 From: Alex Alvarez Date: Sat, 18 May 2013 17:39:49 +0300 Subject: [PATCH] Netsniff.js example should exit with an error when fails to load the adress Issue #11333 https://github.com/ariya/phantomjs/issues/11333 --- examples/netsniff.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/netsniff.js b/examples/netsniff.js index 2574f453..b702543e 100644 --- a/examples/netsniff.js +++ b/examples/netsniff.js @@ -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(); }); }