зеркало из https://github.com/mozilla/gecko-dev.git
Bug 623813 - Preserve stack traces when rethrowing exceptions conditionally. r=mconnor
This commit is contained in:
Родитель
c8be7f77df
Коммит
f25f45ee8f
|
@ -466,18 +466,13 @@ SyncEngine.prototype = {
|
|||
try {
|
||||
try {
|
||||
item.decrypt();
|
||||
} catch (ex) {
|
||||
if (Utils.isHMACMismatch(ex) &&
|
||||
this.handleHMACMismatch()) {
|
||||
// Let's try handling it.
|
||||
// If the callback returns true, try decrypting again, because
|
||||
// we've got new keys.
|
||||
this._log.info("Trying decrypt again...");
|
||||
item.decrypt();
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
} catch (ex if (Utils.isHMACMismatch(ex) &&
|
||||
this.handleHMACMismatch())) {
|
||||
// Let's try handling it.
|
||||
// If the callback returns true, try decrypting again, because
|
||||
// we've got new keys.
|
||||
this._log.info("Trying decrypt again...");
|
||||
item.decrypt();
|
||||
}
|
||||
|
||||
if (this._reconcile(item)) {
|
||||
|
@ -488,14 +483,7 @@ SyncEngine.prototype = {
|
|||
count.reconciled++;
|
||||
this._log.trace("Skipping reconciled incoming item " + item.id);
|
||||
}
|
||||
}
|
||||
catch(ex) {
|
||||
|
||||
if (!Utils.isHMACMismatch(ex)) {
|
||||
// Rethrow anything we shouldn't handle.
|
||||
throw ex;
|
||||
}
|
||||
|
||||
} catch (ex if (Utils.isHMACMismatch(ex))) {
|
||||
this._log.warn("Error processing record: " + Utils.exceptionStr(ex));
|
||||
|
||||
// Upload a new record to replace the bad one if we have it
|
||||
|
|
Загрузка…
Ссылка в новой задаче