Skip to content

Commit 088ea25

Browse files
committed
fix: Exclude onResult call from catch block in provider code
1 parent 9d494fb commit 088ea25

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

calendar/experiments/calendar/parent/ext-calendar-provider.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,17 @@ class ExtCalendar extends cal.provider.BaseClass {
483483
async replayChangesOn(aListener) {
484484
this.offlineStorage.startBatch();
485485
try {
486-
await this.extension.emit("calendar.provider.onSync", this);
487-
aListener.onResult({ status: Cr.NS_OK }, null);
488-
} catch (e) {
489-
console.error(e);
490-
aListener.onResult({ status: e.result || Cr.NS_ERROR_FAILURE }, e.message || e);
486+
let status = Cr.NS_OK
487+
let detail = null;
488+
try {
489+
await this.extension.emit("calendar.provider.onSync", this);
490+
} catch (e) {
491+
status = e.result || Cr.NS_ERROR_FAILURE;
492+
detail = e.message || e;
493+
console.error(e);
494+
}
495+
496+
aListener.onResult({ status }, detail);
491497
} finally {
492498
this.offlineStorage.endBatch();
493499
}

0 commit comments

Comments
 (0)