Bug 1240913 - Catch errors on RDM open / close. r=ochameau draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 19 Apr 2016 15:58:44 -0500
changeset 364633 979e20375575fbd350c4ec9c819a48c0a253552d
parent 364598 6eafc23d044673e709bd215c4ab6511f8f552cb0
child 364634 651a682c1454b8539b05ac3abae8b6282ac238b9
push id17509
push userbmo:jryans@gmail.com
push dateSat, 07 May 2016 02:35:54 +0000
reviewersochameau
bugs1240913
milestone49.0a1
Bug 1240913 - Catch errors on RDM open / close. r=ochameau MozReview-Commit-ID: 8WB989Fy1Ce
devtools/client/responsive.html/manager.js
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -36,17 +36,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
@@ -90,17 +92,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