Plugins: log the original error (#111322)

* chore: log the original error

* ref: create error with cause
This commit is contained in:
Syerikjan Kh
2025-09-18 14:05:31 -04:00
committed by GitHub
parent d96d7e680c
commit af2e349668
@@ -67,7 +67,7 @@ export async function importPluginModule({
}
return SystemJS.import(modulePath).catch((e) => {
let error = new Error('Could not load plugin: ' + e);
let error = new Error('Could not load plugin', { cause: e });
console.error(error);
pluginsLogger.logError(error, {
path,
@@ -77,6 +77,9 @@ export async function importPluginModule({
loadingStrategy: loadingStrategy.toString(),
sriChecksEnabled: String(Boolean(config.featureToggles.pluginsSriChecks)),
newPluginLoadingEnabled: String(Boolean(config.featureToggles.enablePluginImporter)),
originalErrorMessage: e.originalErr?.message || '',
originalErrorStack: e.originalErr?.stack || '',
systemJSOriginalErr: e.originalErr?.message || '',
});
throw error;
});