Bug 1446450 - Show additional error messages in about:debugging-new;r=daisuke

Depends on D20649

Differential Revision: https://phabricator.services.mozilla.com/D20650

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-02-25 13:08:47 +00:00
Родитель 4d09f08e17
Коммит 1d49158674
2 изменённых файлов: 20 добавлений и 8 удалений

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

@ -50,7 +50,7 @@ class RuntimePage extends PureComponent {
showProfilerDialog: PropTypes.bool.isRequired,
tabs: PropTypes.arrayOf(PropTypes.object).isRequired,
temporaryExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
temporaryInstallError: PropTypes.string,
temporaryInstallError: PropTypes.object,
};
}
@ -109,6 +109,23 @@ class RuntimePage extends PureComponent {
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,
@ -121,12 +138,7 @@ class RuntimePage extends PureComponent {
},
dom.span({}, "There was an error during the temporary add-on installation")
),
dom.div(
{
className: "technical-text",
},
temporaryInstallError
)
errors
)
);
}

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

@ -80,7 +80,7 @@ function uiReducer(state = UiState(), action) {
case TEMPORARY_EXTENSION_INSTALL_FAILURE: {
const { error } = action;
return Object.assign({}, state, { temporaryInstallError: error.message });
return Object.assign({}, state, { temporaryInstallError: error });
}
default: