Bug 1154606 - Improve error in debugger when loading source fails. r=jsantell, a=lizzard
authorJames Long <longster@gmail.com>
Wed, 13 May 2015 13:22:00 -0400
changeset 262233 427f3b03a66243ed93628d1119834701322566ff
parent 262232 2d4cc42757490e9da63609b2c645a5e9693727d1
child 262234 940a60bb7865c4c95d185da4822ca90dda3cd081
push id8033
push userryanvm@gmail.com
push dateThu, 21 May 2015 22:07:35 +0000
treeherdermozilla-aurora@c84b63de598f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell, lizzard
bugs1154606
milestone40.0a2
Bug 1154606 - Improve error in debugger when loading source fails. r=jsantell, a=lizzard
browser/devtools/debugger/debugger-view.js
browser/devtools/debugger/test/browser_dbg_scripts-switching-03.js
toolkit/devtools/server/actors/script.js
--- a/browser/devtools/debugger/debugger-view.js
+++ b/browser/devtools/debugger/debugger-view.js
@@ -417,17 +417,18 @@ let DebuggerView = {
 
       histogram.add(Date.now() - startTime);
 
       // Resolve and notify that a source file was shown.
       window.emit(EVENTS.SOURCE_SHOWN, aSource);
       deferred.resolve([aSource, aText, aContentType]);
     },
     ([, aError]) => {
-      let msg = L10N.getStr("errorLoadingText") + DevToolsUtils.safeErrorString(aError);
+      let url = aError;
+      let msg = L10N.getFormatStr("errorLoadingText2", url);
       this._setEditorText(msg);
       Cu.reportError(msg);
       dumpn(msg);
 
       // Reject and notify that there was an error showing the source file.
       window.emit(EVENTS.SOURCE_ERROR_SHOWN, aSource);
       deferred.reject([aSource, aError]);
     });
--- a/browser/devtools/debugger/test/browser_dbg_scripts-switching-03.js
+++ b/browser/devtools/debugger/test/browser_dbg_scripts-switching-03.js
@@ -31,17 +31,17 @@ function test() {
 
 function showBogusSource() {
   let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.SOURCE_ERROR_SHOWN);
   gView._setEditorSource({ url: "http://example.com/fake.js", actor: "fake.actor" });
   return finished;
 }
 
 function testDebuggerLoadingError() {
-  ok(gEditor.getText().includes(gL10N.getStr("errorLoadingText")),
+  ok(gEditor.getText().includes(gL10N.getFormatStr("errorLoadingText2", "noSuchActor")),
     "The valid error loading message is displayed.");
 }
 
 registerCleanupFunction(function() {
   gTab = null;
   gPanel = null;
   gDebugger = null;
   gView = null;
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -2519,17 +2519,17 @@ SourceActor.prototype = {
             content, this.threadActor.threadLifetimePool),
           contentType: contentType
         };
       })
       .then(null, aError => {
         reportError(aError, "Got an exception during SA_onSource: ");
         return {
           "from": this.actorID,
-          "error": "loadSourceError",
+          "error": this.url,
           "message": "Could not load the source for " + this.url + ".\n"
             + DevToolsUtils.safeErrorString(aError)
         };
       });
   },
 
   /**
    * Handler for the "prettyPrint" packet.