From af2e3496682dc7c5f38833e96b695ec753aa4a78 Mon Sep 17 00:00:00 2001 From: Syerikjan Kh Date: Thu, 18 Sep 2025 14:05:31 -0400 Subject: [PATCH] Plugins: log the original error (#111322) * chore: log the original error * ref: create error with cause --- public/app/features/plugins/importer/importPluginModule.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/features/plugins/importer/importPluginModule.ts b/public/app/features/plugins/importer/importPluginModule.ts index 7b73e158881..3ba0f3b58c8 100644 --- a/public/app/features/plugins/importer/importPluginModule.ts +++ b/public/app/features/plugins/importer/importPluginModule.ts @@ -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; });