From 6b42dabf6c3e3e72dd4c5571c20cd2b418fba2c8 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 31 Jan 2021 15:28:06 -0500 Subject: [PATCH] hooks: Delete unused `bubbleExceptions` setting --- src/static/js/pluginfw/hooks.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js index 7ce71ae7b..489e6d6dc 100644 --- a/src/static/js/pluginfw/hooks.js +++ b/src/static/js/pluginfw/hooks.js @@ -26,8 +26,6 @@ const checkDeprecation = (hook) => { // Flattens the array one level. const flatten1 = (array) => array.reduce((a, b) => a.concat(b), []); -exports.bubbleExceptions = true; - const hookCallWrapper = (hook, hookName, args, cb) => { if (cb === undefined) cb = (x) => x; @@ -38,17 +36,7 @@ const hookCallWrapper = (hook, hookName, args, cb) => { if (x === undefined) return []; return x; }; - const normalizedhook = () => normalize(hook.hook_fn(hookName, args, (x) => cb(normalize(x)))); - - if (exports.bubbleExceptions) { - return normalizedhook(); - } else { - try { - return normalizedhook(); - } catch (ex) { - console.error([hookName, hook.part.full_name, ex.stack || ex]); - } - } + return () => normalize(hook.hook_fn(hookName, args, (x) => cb(normalize(x)))); }; exports.syncMapFirst = (lst, fn) => {