Bug 1344504 - handle rejected promise when showing/hiding box model in markup view;r=gl
MozReview-Commit-ID: C3aGIk1RUOU
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -413,30 +413,32 @@ MarkupView.prototype = {
*
* @param {NodeFront} nodeFront
* The node to show the highlighter for
* @return {Promise} Resolves when the highlighter for this nodeFront is
* shown, taking into account that there could already be highlighter
* requests queued up
*/
_showBoxModel: function (nodeFront) {
- return this.toolbox.highlighterUtils.highlightNodeFront(nodeFront);
+ return this.toolbox.highlighterUtils.highlightNodeFront(nodeFront)
+ .catch(this._handleRejectionIfNotDestroyed);
},
/**
* Hide the box model highlighter on a given node front
*
* @param {Boolean} forceHide
* See toolbox-highlighter-utils/unhighlight
* @return {Promise} Resolves when the highlighter for this nodeFront is
* hidden, taking into account that there could already be highlighter
* requests queued up
*/
_hideBoxModel: function (forceHide) {
- return this.toolbox.highlighterUtils.unhighlight(forceHide);
+ return this.toolbox.highlighterUtils.unhighlight(forceHide)
+ .catch(this._handleRejectionIfNotDestroyed);
},
_briefBoxModelTimer: null,
_clearBriefBoxModelTimer: function () {
if (this._briefBoxModelTimer) {
clearTimeout(this._briefBoxModelTimer);
this._briefBoxModelPromise.resolve();