cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject git commit: Handle case where file not found throws exception
Date Tue, 12 Aug 2014 02:07:18 GMT
Repository: cordova-plugin-test-framework
Updated Branches:
  refs/heads/master 1aea19822 -> 75d7bcede


Handle case where file not found throws exception


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/commit/75d7bced
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/tree/75d7bced
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/diff/75d7bced

Branch: refs/heads/master
Commit: 75d7bcede30a599f98272fb7737ff0bf3144ba3b
Parents: 1aea198
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Mon Aug 11 19:06:49 2014 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon Aug 11 19:06:49 2014 -0700

----------------------------------------------------------------------
 www/medic.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework/blob/75d7bced/www/medic.js
----------------------------------------------------------------------
diff --git a/www/medic.js b/www/medic.js
index 6d4f692..4c3a3c2 100644
--- a/www/medic.js
+++ b/www/medic.js
@@ -49,5 +49,15 @@ exports.load = function (callback) {
   xhr.onerror = function() {
    callback();
   }
-  xhr.send();
+
+  try {
+    xhr.send(null);
+  }
+  catch(ex) {
+    // some platforms throw on a file not found
+    console.log('Did not find medic config file');
+    setTimeout(function(){
+        callback();
+    },0);
+  }
 }


Mime
View raw message