From 4fa1bb2ea18057ec4da3359d77612b6407e81e73 Mon Sep 17 00:00:00 2001 From: Elbert Alias Date: Sun, 29 Mar 2015 09:36:27 +1100 Subject: [PATCH] Fixed error handling in PhantomJS driver --- src/drivers/phantomjs/driver.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/drivers/phantomjs/driver.js b/src/drivers/phantomjs/driver.js index 10dafbad9..089799b4e 100644 --- a/src/drivers/phantomjs/driver.js +++ b/src/drivers/phantomjs/driver.js @@ -97,6 +97,8 @@ }; page.onError = function(message) { + + wappalyzer.log('x'); wappalyzer.log(message, 'error'); console.log(JSON.stringify({ applications: [] })); @@ -158,11 +160,15 @@ headers: headers, env: environmentVars }); + + phantom.exit(0); } else { wappalyzer.log('Failed to fetch page'); - } - phantom.exit(status === 'success' ? 0 : 1); + console.log(JSON.stringify({ applications: [] })); + + phantom.exit(1); + } }); } };