You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/12/31 06:56:53 UTC

[03/13] cordova-app-harness git commit: Improved error handling.

Improved error handling.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/a2260d12
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/a2260d12
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/a2260d12

Branch: refs/heads/master
Commit: a2260d12f65b0432b9426b9df7efc4472ad612d6
Parents: 3b91a0c
Author: Max Woghiren <ma...@gmail.com>
Authored: Tue Nov 4 15:09:51 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Dec 31 00:36:25 2014 -0500

----------------------------------------------------------------------
 .../node_modules/cordova-harness-client/harnessclient.js        | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/a2260d12/harness-push/node_modules/cordova-harness-client/harnessclient.js
----------------------------------------------------------------------
diff --git a/harness-push/node_modules/cordova-harness-client/harnessclient.js b/harness-push/node_modules/cordova-harness-client/harnessclient.js
index f11fca5..cf59ebe 100644
--- a/harness-push/node_modules/cordova-harness-client/harnessclient.js
+++ b/harness-push/node_modules/cordova-harness-client/harnessclient.js
@@ -38,7 +38,8 @@ function doRequest(method, target, action, options) {
     client.listDevices()
     .then(function(devices) {
         if (devices.length === 0) {
-            console.error('No devices detected.');
+            deferred.reject('No devices detected.');
+            return;
         }
 
         // We use the first device.
@@ -65,6 +66,8 @@ function doRequest(method, target, action, options) {
                 this.createSocketCount++;
                 return socket;
             };
+        }, function(error) {
+            deferred.reject('\nCould not connect to the device. Make sure you have the Chrome App Developer Tool for Mobile open.');
         }).then(function() {
             var targetParts = target.split(':');
             var host = targetParts[0];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org