Correct network handling in findCluster

--HG--
extra : rebase_source : 7e5d2eee8927d95d17d8449bc6789619a1ac8af8
This commit is contained in:
Anant Narayanan 2009-08-20 12:14:34 -07:00
Родитель 50556dbbd9
Коммит 89948abfa1
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -472,7 +472,9 @@ WeaveSvc.prototype = {
let res = new Resource(this.baseURL + "api/register/chknode/" + username);
try {
res.get();
} catch(ex) {}
try {
switch (res.lastChannel.responseStatus) {
case 404:
this._log.debug("Using serverURL as data cluster (multi-cluster support disabled)");
@ -483,9 +485,11 @@ WeaveSvc.prototype = {
this._log.debug("Unexpected response code trying to find cluster: " + res.lastChannel.responseStatus);
break;
}
} catch(ex) { /* if the channel failed to start we'll get here, just return false */}
return false;
} catch (e) {
this._log.debug("Network error on findCluster");
this._setSyncFailure(LOGIN_FAILED_NETWORK_ERROR);
throw e;
}
},
// gets cluster from central LDAP server and sets this.clusterURL