Catch the JSON undefined error

This commit is contained in:
Gaël Métais
2014-09-05 10:52:57 +02:00
parent 21c3a7590e
commit 2e25cd404b
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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);
}
+1
View File
@@ -31,6 +31,7 @@
<div ng-if="phantomasResults.error == 254">Phantomas failed to load page</div>
<div ng-if="phantomasResults.error == 255">Phantomas internal error</div>
<div ng-if="phantomasResults.error == 1001">Javascript execution tree error</div>
<div ng-if="phantomasResults.error == 1002">JSON undefined error</div>
</div>
<div ng-show="view == 'summary' && !phantomasResults.error" class="summary">