Bug 1446450 - Forward detailed errors for "Extension is invalid" errors;r=aswan
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 25 Feb 2019 13:07:40 +0000
changeset 519059 53b94170e1003ab02c3562e9dde8661d1578aec2
parent 519058 c300840573f5548de1b1aeb68c6e60ef1d1487bc
child 519060 f1993f5194af17c5c16dd0d557f99654c570a0c1
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)
reviewersaswan
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 - Forward detailed errors for "Extension is invalid" errors;r=aswan Differential Revision: https://phabricator.services.mozilla.com/D20648
toolkit/mozapps/extensions/internal/XPIInstall.jsm
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -390,17 +390,21 @@ async function loadManifestFromWebManife
   let manifest = await extension.loadManifest();
 
   // Read the list of available locales, and pre-load messages for
   // all locales.
   let locales = (extension.errors.length == 0) ?
                 await extension.initAllLocales() : null;
 
   if (extension.errors.length > 0) {
-    throw new Error("Extension is invalid");
+    let error = new Error("Extension is invalid");
+    // Add detailed errors on the error object so that the front end can display them
+    // if needed (eg in about:debugging).
+    error.additionalErrors = extension.errors;
+    throw error;
   }
 
   let bss = (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko)
       || (manifest.applications && manifest.applications.gecko) || {};
   if (manifest.browser_specific_settings && manifest.applications) {
     logger.warn("Ignoring applications property in manifest");
   }