From 7e698baa80daf7b1133e5a85ebe3ccc5afa100a9 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 3 Mar 2021 03:10:49 -0500 Subject: [PATCH] pluginfw: Improve hook function load error message --- src/static/js/pluginfw/shared.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/static/js/pluginfw/shared.js b/src/static/js/pluginfw/shared.js index a78697a2a..2c81ccd81 100644 --- a/src/static/js/pluginfw/shared.js +++ b/src/static/js/pluginfw/shared.js @@ -55,9 +55,10 @@ const extractHooks = (parts, hookSetName, normalizer) => { try { hookFn = loadFn(hookFnName, hookName); if (!hookFn) throw new Error('Not a function'); - } catch (exc) { - console.error(`Failed to load '${hookFnName}' for ` + - `'${part.full_name}/${hookSetName}/${hookName}': ${exc.toString()}`); + } catch (err) { + console.error(`Failed to load hook function "${hookFnName}" for plugin "${part.plugin}" ` + + `part "${part.name}" hook set "${hookSetName}" hook "${hookName}": ` + + `${err.stack || err}`); } if (hookFn) { if (hooks[hookName] == null) hooks[hookName] = [];