From 2cf633a3fbaa278655e6e3840280ee674a08f2b1 Mon Sep 17 00:00:00 2001 From: Brian Grinstead Date: Tue, 17 Mar 2015 14:55:00 -0400 Subject: [PATCH] Bug 1144392 - Show an error message in the Browser Toolbox if the connection fails. r=jryans --- browser/devtools/framework/toolbox-process-window.js | 8 +++++++- browser/devtools/framework/toolbox-process-window.xul | 4 ++++ browser/locales/en-US/chrome/browser/devtools/toolbox.dtd | 4 ++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/browser/devtools/framework/toolbox-process-window.js b/browser/devtools/framework/toolbox-process-window.js index ddf65fa4fabc..e6416503a0e6 100644 --- a/browser/devtools/framework/toolbox-process-window.js +++ b/browser/devtools/framework/toolbox-process-window.js @@ -62,7 +62,13 @@ window.addEventListener("load", function() { let cmdClose = document.getElementById("toolbox-cmd-close"); cmdClose.addEventListener("command", onCloseCommand); setPrefDefaults(); - connect().catch(Cu.reportError); + connect().catch(e => { + let errorMessageContainer = document.getElementById("error-message-container"); + let errorMessage = document.getElementById("error-message"); + errorMessage.value = e; + errorMessageContainer.hidden = false; + Cu.reportError(e); + }); }); function onCloseCommand(event) { diff --git a/browser/devtools/framework/toolbox-process-window.xul b/browser/devtools/framework/toolbox-process-window.xul index 4d1907c82613..d0f774b867fa 100644 --- a/browser/devtools/framework/toolbox-process-window.xul +++ b/browser/devtools/framework/toolbox-process-window.xul @@ -37,5 +37,9 @@ for example when viewing network request details. --> + diff --git a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd index 79bf11a2cfd9..74315e898d6e 100644 --- a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd @@ -23,6 +23,10 @@ - It allows you to switch the context of the whole toolbox. --> + + +