Bug 1128785 - ensureLoggedIn() failure is now always noticed by Sync. r=rnewman

This commit is contained in:
Mark Hammond 2015-03-05 16:32:18 +11:00
parent 76a28549f9
commit 3639359323
2 changed files with 5 additions and 2 deletions

View File

@ -144,7 +144,7 @@ this.BrowserIDManager.prototype = {
// re-entering of credentials by the user is necessary we don't take any
// further action - an observer will fire when the user does that.
if (Weave.Status.login == LOGIN_FAILED_LOGIN_REJECTED) {
return Promise.reject();
return Promise.reject(new Error("User needs to re-authenticate"));
}
// So - we've a previous auth problem and aren't currently attempting to

View File

@ -978,7 +978,10 @@ Sync11Service.prototype = {
// Ask the identity manager to explicitly login now.
let cb = Async.makeSpinningCallback();
this.identity.ensureLoggedIn().then(cb, cb);
this.identity.ensureLoggedIn().then(
() => cb(null),
err => cb(err || "ensureLoggedIn failed")
);
// Just let any errors bubble up - they've more context than we do!
cb.wait();