Bug 1446450 - Show additional error messages in about:debugging;r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 25 Feb 2019 13:08:09 +0000
changeset 519060 f1993f5194af17c5c16dd0d557f99654c570a0c1
parent 519059 53b94170e1003ab02c3562e9dde8661d1578aec2
child 519061 55f4f862586c780be072f9da874fc36fd2e3ac28
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaisuke
bugs1446450
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446450 - Show additional error messages in about:debugging;r=daisuke Depends on D20648 Differential Revision: https://phabricator.services.mozilla.com/D20649
devtools/client/aboutdebugging/aboutdebugging.css
devtools/client/aboutdebugging/components/addons/Controls.js
devtools/client/aboutdebugging/components/addons/InstallError.js
--- a/devtools/client/aboutdebugging/aboutdebugging.css
+++ b/devtools/client/aboutdebugging/aboutdebugging.css
@@ -202,16 +202,22 @@ button {
 
 .addons-install-error .warning,
 .service-worker-multi-process .warning {
   /* The warning icon can be hard to see on red / yellow backgrounds, this turns the icon
   to a black icon. */
   fill: #0c0c0d;
 }
 
+.addons-install-error__additional-errors {
+  font-family: monospace;
+  font-size: 13px;
+  margin-block: 8px;
+}
+
 .addons-options {
   flex: 1;
 }
 
 .service-worker-disabled-label,
 .addons-debugging-label,
 .addons-web-ext-tip {
   display: inline-block;
--- a/devtools/client/aboutdebugging/components/addons/Controls.js
+++ b/devtools/client/aboutdebugging/components/addons/Controls.js
@@ -62,17 +62,17 @@ class AddonsControls extends Component {
 
   installAddon(file) {
     AddonManager.installTemporaryAddon(file)
       .then(() => {
         this.setState({ lastInstallErrorFile: null });
       })
       .catch(e => {
         console.error(e);
-        this.setState({ installError: e.message, lastInstallErrorFile: file });
+        this.setState({ installError: e, lastInstallErrorFile: file });
       });
   }
 
   render() {
     const { debugDisabled } = this.props;
 
     return dom.div({ className: "addons-top" },
       dom.div({ className: "addons-controls" },
--- a/devtools/client/aboutdebugging/components/addons/InstallError.js
+++ b/devtools/client/aboutdebugging/components/addons/InstallError.js
@@ -12,32 +12,41 @@ const dom = require("devtools/client/sha
 const Services = require("Services");
 
 const Strings = Services.strings.createBundle(
   "chrome://devtools/locale/aboutdebugging.properties");
 
 class AddonsInstallError extends Component {
   static get propTypes() {
     return {
-      error: PropTypes.string,
+      error: PropTypes.object,
       retryInstall: PropTypes.func,
     };
   }
 
   render() {
+    const { error } = this.props;
     if (!this.props.error) {
       return null;
     }
-    const text = Strings.formatStringFromName("addonInstallError", [this.props.error], 1);
+    const text = Strings.formatStringFromName("addonInstallError", [error.message], 1);
+
+    const additionalErrors = Array.isArray(error.additionalErrors) ?
+      dom.div(
+        { className: "addons-install-error__additional-errors" },
+        error.additionalErrors.join(" ")
+      ) : null;
+
     return dom.div(
       { className: "addons-install-error" },
       dom.span(
         {},
         dom.div({ className: "warning" }),
         dom.span({}, text),
+        additionalErrors
       ),
       dom.button(
         { className: "addons-install-retry", onClick: this.props.retryInstall },
         Strings.GetStringFromName("retryTemporaryInstall")));
   }
 }
 
 module.exports = AddonsInstallError;