Bug 1418853 - Don't report handled rejections in `nsLivemarksService`. r?mak
`_withLivemarksMap` and `_invalidateCachedLivemarks` already return the
chained promise, so callers can handle rejections. We shouldn't log
errors for handled rejections.
MozReview-Commit-ID: 2zAzf3aeFxI
--- a/toolkit/components/places/nsLivemarkService.js
+++ b/toolkit/components/places/nsLivemarkService.js
@@ -110,17 +110,17 @@ LivemarkService.prototype = {
feedURI: NetUtil.newURI(row.getResultByName("feedURI")),
siteURI: siteURI ? NetUtil.newURI(siteURI) : null
});
this._livemarksMap.set(livemark.guid, livemark);
}
}
return func(this._livemarksMap);
});
- this._promiseLivemarksMapReady = promise.catch(Cu.reportError);
+ this._promiseLivemarksMapReady = promise.catch(_ => {});
return promise;
},
_reloading: false,
_startReloadTimer(livemarksMap, forceUpdate, reloaded) {
if (this._reloadTimer) {
this._reloadTimer.cancel();
} else {
@@ -315,26 +315,28 @@ LivemarkService.prototype = {
this._livemarksMap = null;
if (livemarksMap) {
// Stop any ongoing network fetch.
for (let livemark of livemarksMap.values()) {
livemark.terminate();
}
}
});
- this._promiseLivemarksMapReady = promise.catch(Cu.reportError);
+ this._promiseLivemarksMapReady = promise.catch(_ => {});
// Restart the timer if we were reloading before invalidating.
if (keepReloading) {
if (wasReloading) {
this.reloadLivemarks(wasForceUpdating);
}
} else {
delete this._reloadTimer;
}
+
+ return promise;
},
invalidateCachedLivemarks() {
return this._invalidateCachedLivemarks();
},
// nsINavBookmarkObserver