Update popup message for incorret password 73/17173/1
authorJimmy Huang <jimmy.huang@intel.com>
Tue, 4 Mar 2014 20:08:15 +0000 (12:08 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Tue, 4 Mar 2014 20:08:15 +0000 (12:08 -0800)
Instead of showing connman error for invalid arguments when trying to connect to an encrypts AP, now it shows "Password incorrect" which is more user friendly.

Change-Id: I0f92f1c8cc1d458c2b98b2c0d46c2136eef92dc9
Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
js/panel-connman.js

index 48dbe39..b3e605c 100644 (file)
@@ -165,7 +165,7 @@ function connmanPanelInit() {
                 $.mobile.changePage('#page_connman');
             }
         }, function(e) {
-            showMsg('Error', 'Connect service failed: ' + e);
+            showMsg('Error', 'Connect failed: ' + e);
         });
     });
 }
@@ -805,7 +805,11 @@ function connmanConnectToService(service, passphrase, success_cb, error_cb) {
         /* error */
         hideSpinner();
         if (error_cb) {
-            error_cb(e);
+            if (e.indexOf('Invalid arguments') >= 0) {
+                error_cb('Password incorrect');
+            } else {
+                error_cb(e);
+            }
         }
     });
 }