From 2e25cd404b9d0b4da7a5674af9b0d5fd93e9e16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Fri, 5 Sep 2014 10:52:57 +0200 Subject: [PATCH] Catch the JSON undefined error --- app/lib/phantomasWrapper.js | 5 +++++ app/node_views/results.html | 1 + 2 files changed, 6 insertions(+) diff --git a/app/lib/phantomasWrapper.js b/app/lib/phantomasWrapper.js index a9cdea5..2bed7d5 100644 --- a/app/lib/phantomasWrapper.js +++ b/app/lib/phantomasWrapper.js @@ -87,6 +87,11 @@ var PhantomasWrapper = function() { err = null; } + // Strange bug: no err but no json either + if (!json && json == 'undefined') { + err = 1002; + } + if (err) { console.log('Attempt failed for test id ' + task.testId + '. Error code ' + err); } diff --git a/app/node_views/results.html b/app/node_views/results.html index 1c27311..980fac0 100644 --- a/app/node_views/results.html +++ b/app/node_views/results.html @@ -31,6 +31,7 @@
Phantomas failed to load page
Phantomas internal error
Javascript execution tree error
+
JSON undefined error