Bug 1473418 - Improve exception message occuring during toolbox opening. r=jryans draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 04 Jul 2018 15:13:07 -0700
changeset 815546 54a24439f5aa58e655c8b1dd8b585b01c4ea100d
parent 815516 ffb7b5015fc331bdc4c5e6ab52b9de669faa8864
push id115544
push userbmo:poirot.alex@gmail.com
push dateMon, 09 Jul 2018 09:48:42 +0000
reviewersjryans
bugs1473418
milestone63.0a1
Bug 1473418 - Improve exception message occuring during toolbox opening. r=jryans MozReview-Commit-ID: HFXiyNzstGK
devtools/client/framework/toolbox.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -571,17 +571,22 @@ Toolbox.prototype = {
       // so we don't have to explicitly wait for this in tests; ideally, all tests
       // will handle this on their own, but each have their own tear down function.
       if (flags.testing) {
         await performanceFrontConnection;
       }
 
       this.emit("ready");
       this._resolveIsOpen();
-    }.bind(this))().catch(console.error);
+    }.bind(this))().catch(e => {
+      console.error("Exception while opening the toolbox", String(e), e);
+      // While the exception stack is correctly printed in the Browser console when
+      // passing `e` to console.error, it is not on the stdout, so print it via dump.
+      dump(e.stack + "\n");
+    });
   },
 
   /**
    * loading React modules when needed (to avoid performance penalties
    * during Firefox start up time).
    */
   get React() {
     return this.browserRequire("devtools/client/shared/vendor/react");