Bug 1179820 - Log some exceptions caught in the style editor; r?gl draft
authorTom Tromey <tom@tromey.com>
Fri, 29 Sep 2017 11:23:58 -0600
changeset 680884 0957e155142ee8379c6153dd3c51de119b2f16f7
parent 680883 546f37bddd286e0978a93cd096e3889acb45bc89
child 680885 ad6cfa8e25b6cee04002d60d1482d6083c3f2eb0
push id84661
push userbmo:ttromey@mozilla.com
push dateMon, 16 Oct 2017 14:19:39 +0000
reviewersgl
bugs1179820
milestone58.0a1
Bug 1179820 - Log some exceptions caught in the style editor; r?gl This has been handy for debugging, and it seems fine to simply leave it in. MozReview-Commit-ID: 6nm0RxPm4Zq
devtools/client/styleeditor/StyleEditorUI.jsm
devtools/client/styleeditor/StyleSheetEditor.jsm
--- a/devtools/client/styleeditor/StyleEditorUI.jsm
+++ b/devtools/client/styleeditor/StyleEditorUI.jsm
@@ -259,16 +259,17 @@ StyleEditorUI.prototype = {
   _resetStyleSheetList: Task.async(function* (styleSheets) {
     this._clear();
     this._suppressAdd = false;
 
     for (let sheet of styleSheets) {
       try {
         yield this._addStyleSheet(sheet);
       } catch (e) {
+        console.error(e);
         this.emit("error", { key: LOAD_ERROR });
       }
     }
 
     this._root.classList.remove("loading");
 
     this.emit("stylesheets-reset");
   }),
--- a/devtools/client/styleeditor/StyleSheetEditor.jsm
+++ b/devtools/client/styleeditor/StyleSheetEditor.jsm
@@ -292,16 +292,17 @@ StyleSheetEditor.prototype = {
       return source;
     }).catch(e => {
       if (this._isDestroyed) {
         console.warn("Could not fetch the source for " +
                      this.styleSheet.href +
                      ", the editor was destroyed");
         console.error(e);
       } else {
+        console.error(e);
         this.emit("error", { key: LOAD_ERROR, append: this.styleSheet.href });
         throw e;
       }
     });
   },
 
   /**
    * Add markup to a region. UNUSED_CLASS is added to specified lines