Bug 842147 - Translate JS exception from CaptivePortalDetector into informative debug message. r=vchang
authorShih-Chiang Chien <schien@mozilla.com>
Tue, 05 Mar 2013 09:56:34 -0500
changeset 123825 3003f5aa28d44f8aa42e3348becaed5e86e497c3
parent 123824 d253208c90bcb2744c2dd86b702e8f1f2b6dd957
child 123826 dd75eab24983ba50e14c6cc4a67b1fda2264bd1e
push id1401
push userpastithas@mozilla.com
push dateThu, 07 Mar 2013 07:26:45 +0000
treeherderfx-team@ee4879719f78 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvchang
bugs842147
milestone22.0a1
Bug 842147 - Translate JS exception from CaptivePortalDetector into informative debug message. r=vchang
dom/system/gonk/NetworkManager.js
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -863,18 +863,22 @@ let CaptivePortalDetectionHelper = (func
       }
     };
 
     // Abort any unfinished captive portal detection.
     if (_ongoingInterface != null) {
       capService.abort(_ongoingInterface);
       _ongoingInterface = null;
     }
-    capService.checkCaptivePortal(interfaceName, capCallback);
-    _ongoingInterface = interfaceName;
+    try {
+      capService.checkCaptivePortal(interfaceName, capCallback);
+      _ongoingInterface = interfaceName;
+    } catch (e) {
+      debug('Fail to detect captive portal due to: ' + e.message);
+    }
   };
 
   let _abort = function (interfaceName) {
     if (_ongoingInterface !== interfaceName) {
       return;
     }
 
     let capService = getService();