Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws
authorWolfram Schneider <wosch@indexdata.dk>
Tue, 4 Feb 2014 16:31:53 +0000 (16:31 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Tue, 4 Feb 2014 16:31:53 +0000 (16:31 +0000)
test/phantom/evaluate.js

index ccf01e4..8cc4c3e 100644 (file)
@@ -76,12 +76,18 @@ page.onAlert = function (msg) {
     console.log("Alert: " + msg);
 };
 
+// display HTTP errors
+page.onResourceError = function (resourceError) {
+    // console.log('phantomjs error code: ' + resourceError.errorCode);
+    console.log(resourceError.errorString);
+    phantom.exit(3);
+};
 
 page.open(url, function (status) {
     if (debug >= 1) console.log("fetch " + url + " with status: " + status);
 
     if (status != 'success') {
-        console.log("Failed to fetch page, give up");
+        console.log("Failed to fetch page, give up. Network error?");
         phantom.exit(1);
     }