You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/12 04:07:18 UTC
git commit: Handle case where file not found throws exception
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 <pu...@gmail.com>
Authored: Mon Aug 11 19:06:49 2014 -0700
Committer: Jesse MacFadyen <pu...@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);
+ }
}