Bug 536594 - Warn on record creation failure but continue the sync

Wrap createRecord and encrypt incase an engine fails to create one or more of the records similar to how process incoming records are wrapped.
This commit is contained in:
Edward Lee 2010-01-06 09:59:05 -08:00
parent 5a569bea45
commit 138e3682ad

View File

@ -642,12 +642,17 @@ SyncEngine.prototype = {
this._store.cache.enabled = false;
for (let id in this._tracker.changedIDs) {
let out = this._createRecord(id);
if (this._log.level <= Log4Moz.Level.Trace)
this._log.trace("Outgoing: " + out);
try {
let out = this._createRecord(id);
if (this._log.level <= Log4Moz.Level.Trace)
this._log.trace("Outgoing: " + out);
out.encrypt(ID.get("WeaveCryptoID"));
up.pushData(out);
out.encrypt(ID.get("WeaveCryptoID"));
up.pushData(out);
}
catch(ex) {
this._log.warn("Error creating record: " + Utils.exceptionStr(ex));
}
// Partial upload
if ((++count % MAX_UPLOAD_RECORDS) == 0)