catch exceptions when trying to find out user's cluster
authorDan Mills <thunder@mozilla.com>
Tue, 10 Feb 2009 17:50:40 -0800
changeset 45236 99bd435ddffc1f8d224034bec5fbc11e794cebb1
parent 45235 eeb85b7edcab0dfbc5325a3f1403fed24ee7d871
child 45237 1d96c888d733a3176b6c5e9a44a94c6f428700e8
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
catch exceptions when trying to find out user's cluster
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -429,18 +429,20 @@ WeaveSvc.prototype = {
 
   // gets cluster from central LDAP server and sets this.clusterURL
   findCluster: function WeaveSvc_findCluster(onComplete, username) {
     let fn = function WeaveSvc__findCluster() {
       let self = yield;
       let ret = false;
 
       this._log.debug("Finding cluster for user " + username);
-      let res = new Resource(this.baseURL + "api/register/chknode/" + username);
-      yield res.get(self.cb);
+      try {
+	let res = new Resource(this.baseURL + "api/register/chknode/" + username);
+	yield res.get(self.cb);
+      } catch (e) { /* we check status below */ }
 
       if (res.lastChannel.responseStatus == 404) {
         this._log.debug("Using serverURL as data cluster (multi-cluster support disabled)");
         this.clusterURL = Svc.Prefs.get("serverURL");
         ret = true;
 
       } else if (res.lastChannel.responseStatus == 200) {
         this.clusterURL = 'https://' + res.data + '/';