Bug 1446450 - Show additional error messages in about:debugging-new;r=daisuke
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 25 Feb 2019 13:08:47 +0000
changeset 519061 55f4f862586c780be072f9da874fc36fd2e3ac28
parent 519060 f1993f5194af17c5c16dd0d557f99654c570a0c1
child 519062 6ab8ccf59cae44471b849874f785ee5c819ec98f
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-new;r=daisuke Depends on D20649 Differential Revision: https://phabricator.services.mozilla.com/D20650
devtools/client/aboutdebugging-new/src/components/RuntimePage.js
devtools/client/aboutdebugging-new/src/reducers/ui-state.js
--- a/devtools/client/aboutdebugging-new/src/components/RuntimePage.js
+++ b/devtools/client/aboutdebugging-new/src/components/RuntimePage.js
@@ -45,17 +45,17 @@ class RuntimePage extends PureComponent 
       otherWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       runtimeDetails: Types.runtimeDetails,
       runtimeId: PropTypes.string.isRequired,
       serviceWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       sharedWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       showProfilerDialog: PropTypes.bool.isRequired,
       tabs: PropTypes.arrayOf(PropTypes.object).isRequired,
       temporaryExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
-      temporaryInstallError: PropTypes.string,
+      temporaryInstallError: PropTypes.object,
     };
   }
 
   // TODO: avoid the use of this method
   // https://bugzilla.mozilla.org/show_bug.cgi?id=1508688
   componentWillMount() {
     const { dispatch, runtimeId } = this.props;
     dispatch(Actions.selectPage(PAGE_TYPES.RUNTIME, runtimeId));
@@ -104,34 +104,46 @@ class RuntimePage extends PureComponent 
     const { runtimeDetails, temporaryInstallError } = this.props;
     const { type } = runtimeDetails.info;
 
     if (!temporaryInstallError ||
         !isSupportedDebugTargetPane(type, DEBUG_TARGET_PANE.TEMPORARY_EXTENSION)) {
       return null;
     }
 
+    let errorMessages = [temporaryInstallError.message];
+
+    // Additional error messages can be found in additionalErrors.
+    if (Array.isArray(temporaryInstallError.additionalErrors)) {
+      errorMessages = errorMessages.concat(temporaryInstallError.additionalErrors);
+    }
+
+    const errors = errorMessages.map((message, index) => {
+      return dom.div(
+        {
+          className: "technical-text",
+          key: "tmp-extension-install-error-" + index,
+        },
+        message
+      );
+    });
+
     return Message(
       {
         level: MESSAGE_LEVEL.ERROR,
       },
       dom.div(
         {},
         Localized(
           {
             id: "about-debugging-tmp-extension-install-error",
           },
           dom.span({}, "There was an error during the temporary add-on installation")
         ),
-        dom.div(
-          {
-            className: "technical-text",
-          },
-          temporaryInstallError
-        )
+        errors
       )
     );
   }
 
   render() {
     const {
       dispatch,
       installedExtensions,
--- a/devtools/client/aboutdebugging-new/src/reducers/ui-state.js
+++ b/devtools/client/aboutdebugging-new/src/reducers/ui-state.js
@@ -75,17 +75,17 @@ function uiReducer(state = UiState(), ac
     }
 
     case TEMPORARY_EXTENSION_INSTALL_SUCCESS: {
       return Object.assign({}, state, { temporaryInstallError: null });
     }
 
     case TEMPORARY_EXTENSION_INSTALL_FAILURE: {
       const { error } = action;
-      return Object.assign({}, state, { temporaryInstallError: error.message });
+      return Object.assign({}, state, { temporaryInstallError: error });
     }
 
     default:
       return state;
   }
 }
 
 module.exports = {