keep track of errors during sync and throw after trying all engines

This commit is contained in:
Dan Mills 2008-07-08 17:44:00 -07:00
Родитель 292500626c
Коммит 96c7ee8c92
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -663,6 +663,11 @@ WeaveSvc.prototype = {
yield this._notify(engines[i].name + "-engine:sync",
this._syncEngine, engines[i]).async(this, self.cb);
}
if (this._syncError) {
this._syncError = false;
throw "Some engines did not sync correctly";
}
},
// The values that engine scores must meet or exceed before we sync them
@ -716,6 +721,11 @@ WeaveSvc.prototype = {
this._syncThresholds[engine.name] = 1;
}
}
if (this._syncError) {
this._syncError = false;
throw "Some engines did not sync correctly";
}
},
_syncEngine: function WeaveSvc__syncEngine(engine) {
@ -726,6 +736,7 @@ WeaveSvc.prototype = {
} catch(e) {
this._log.error(Utils.exceptionStr(e));
this._log.error(Utils.stackTrace(e));
this._syncError = true;
}
},