Bug 1154606 - improve error in debugger when loading source fails r=jsantell

This commit is contained in:
James Long 2015-05-13 16:11:33 -04:00
Родитель 8991f43d1f
Коммит 1c9effd975
4 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -422,7 +422,8 @@ let DebuggerView = {
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);

Просмотреть файл

@ -36,7 +36,7 @@ function showBogusSource() {
}
function testDebuggerLoadingError() {
ok(gEditor.getText().includes(gL10N.getStr("errorLoadingText")),
ok(gEditor.getText().includes(gL10N.getFormatStr("errorLoadingText2", "noSuchActor")),
"The valid error loading message is displayed.");
}

Просмотреть файл

@ -214,10 +214,6 @@ breakpointMenuItem.deleteAll=Remove all breakpoints
# yet.
loadingText=Loading\u2026
# LOCALIZATION NOTE (errorLoadingText): The text that is displayed in the debugger
# viewer when there is an error loading a file
errorLoadingText=Error loading source:\n
# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger
# viewer when there is an error loading a file
errorLoadingText2=Error loading this URL: %S
@ -325,4 +321,4 @@ variablesViewUninitialized=(uninitialized)
variablesViewMissingArgs=(unavailable)
evalGroupLabel=Evaluated Sources
anonymousSourcesLabel=Anonymous Sources
anonymousSourcesLabel=Anonymous Sources

Просмотреть файл

@ -2522,7 +2522,7 @@ SourceActor.prototype = {
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)
};