B2G/gecko/services/sync/modules/service.js
// gets cluster from central LDAP server and returns it, or null on error
gets cluster from central LDAP server and returns it, or null on error
gets cluster from central LDAP server and returns it or null on error
function _findCluster() {
    this._log.debug("Finding cluster for user " + this._identity.username);
    let fail;
    let res = new Resource(this.userAPI + this._identity.username + "/node/weave");
    try {
      let node = res.get();
      switch (node.status) {
        case 400:
          Status.login = LOGIN_FAILED_LOGIN_REJECTED;
          fail = "Find cluster denied: " + ErrorHandler.errorStr(node);
          break;
        case 404:
          this._log.debug("Using serverURL as data cluster (multi-cluster support disabled)");
          return this.serverURL;
        case 0:
        case 200:
          if (node == "null") {
            node = null;
          }
          this._log.trace("_findCluster successfully returning " + node);
          return node;
        default:
          ErrorHandler.checkServerError(node);
          fail = "Unexpected response code: " + node.status;
          break;
      }
    } catch (e) {
      this._log.debug("Network error on findCluster");
      Status.login = LOGIN_FAILED_NETWORK_ERROR;
      ErrorHandler.checkServerError(e);
      fail = e;
    }
    throw fail;
  }
function _findCluster ( ) { this . _log . debug ( "Finding cluster for user " + this . _identity . username ) ; let fail ; let res = new Resource ( this . userAPI + this . _identity . username + "/node/weave" ) ; try { let node = res . get ( ) ; switch ( node . status ) { case 400 : Status . login = LOGIN_FAILED_LOGIN_REJECTED ; fail = "Find cluster denied: " + ErrorHandler . errorStr ( node ) ; break ; case 404 : this . _log . debug ( "Using serverURL as data cluster (multi-cluster support disabled)" ) ; return this . serverURL ; case 0 : case 200 : if ( node == "null" ) { node = null ; } this . _log . trace ( "_findCluster successfully returning " + node ) ; return node ; default : ErrorHandler . checkServerError ( node ) ; fail = "Unexpected response code: " + node . status ; break ; } } catch ( e ) { this . _log . debug ( "Network error on findCluster" ) ; Status . login = LOGIN_FAILED_NETWORK_ERROR ; ErrorHandler . checkServerError ( e ) ; fail = e ; } throw fail ; }
gets cluster from central LDAP server and returns it, or null on error
gets cluster from central LDAP server and returns it or null on error