Bug 1474609 - Improve exception logging during Debugger main module loading. r=jlast draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 10 Jul 2018 07:58:48 -0700
changeset 816062 d6814cf79c7d0882792464d4930ae632bfd9ef12
parent 815516 ffb7b5015fc331bdc4c5e6ab52b9de669faa8864
push id115737
push userbmo:poirot.alex@gmail.com
push dateTue, 10 Jul 2018 15:00:27 +0000
reviewersjlast
bugs1474609
milestone63.0a1
Bug 1474609 - Improve exception logging during Debugger main module loading. r=jlast MozReview-Commit-ID: HPexsoSCUBC
devtools/client/debugger/new/index.html
--- a/devtools/client/debugger/new/index.html
+++ b/devtools/client/debugger/new/index.html
@@ -10,18 +10,24 @@
   <link rel="stylesheet" type="text/css" href="chrome://devtools/content/sourceeditor/codemirror/mozilla.css" />
   <link rel="stylesheet" type="text/css" href="resource://devtools/client/debugger/new/dist/debugger.css" />
 </head>
 
 <body>
   <div id="mount"></div>
   <script type="application/javascript" src="chrome://devtools/content/shared/theme-switching.js"></script>
   <script type="text/javascript">
-    const { BrowserLoader } = ChromeUtils.import("resource://devtools/client/shared/browser-loader.js", {});
-    const { require } = BrowserLoader({
-      baseURI: "resource://devtools/client/debugger/new",
-      window,
-    });
-    Debugger = require("devtools/client/debugger/new/src/main");
+    try {
+      const { BrowserLoader } = ChromeUtils.import("resource://devtools/client/shared/browser-loader.js", {});
+      const { require } = BrowserLoader({
+        baseURI: "resource://devtools/client/debugger/new",
+        window,
+      });
+      Debugger = require("devtools/client/debugger/new/src/main");
+    } catch(e) {
+      dump("Exception happened while loading the debugger:\n");
+      dump(e + "\n");
+      dump(e.stack + "\n");
+    }
   </script>
 </body>
 
-</html>
\ No newline at end of file
+</html>