Bug 1240913 - Catch errors on RDM open / close. r=ochameau
MozReview-Commit-ID: 8WB989Fy1Ce
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -37,17 +37,19 @@ const ResponsiveUIManager = exports.Resp
* The browser tab.
* @return Promise
* Resolved when the toggling has completed. If the UI has opened,
* it is resolved to the ResponsiveUI instance for this tab. If the
* the UI has closed, there is no resolution value.
*/
toggle(window, tab) {
let action = this.isActiveForTab(tab) ? "close" : "open";
- return this[action + "IfNeeded"](window, tab);
+ let completed = this[action + "IfNeeded"](window, tab);
+ completed.catch(console.error);
+ return completed;
},
/**
* Opens the responsive UI, if not already open.
*
* @param window
* The main browser chrome window.
* @param tab
@@ -91,17 +93,16 @@ const ResponsiveUIManager = exports.Resp
off(events.close, "data", onClose);
}
yield ui.destroy();
this.emit("off", { tab });
yield setMenuCheckFor(tab, window);
}
- return promise.resolve();
}),
/**
* Returns true if responsive UI is active for a given tab.
*
* @param tab
* The browser tab.
* @return boolean