From 4253a2ea8f595090d8b9cae72c53cedeb4885934 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 18 Feb 2021 02:36:50 -0500 Subject: [PATCH] plugins: Move hook call and plugin update out of try block Exceptions thrown by these function calls are serious and should crash Etherpad. --- src/static/js/pluginfw/installer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/static/js/pluginfw/installer.js b/src/static/js/pluginfw/installer.js index a0f60d825..4d2e223d5 100644 --- a/src/static/js/pluginfw/installer.js +++ b/src/static/js/pluginfw/installer.js @@ -36,12 +36,12 @@ exports.uninstall = async (pluginName, cb = null) => { try { await loadNpm(); await util.promisify(npm.commands.uninstall)([pluginName]); - await hooks.aCallAll('pluginUninstall', {pluginName}); - await plugins.update(); } catch (err) { cb(err || new Error(err)); throw err; } + await hooks.aCallAll('pluginUninstall', {pluginName}); + await plugins.update(); cb(null); }; @@ -50,12 +50,12 @@ exports.install = async (pluginName, cb = null) => { try { await loadNpm(); await util.promisify(npm.commands.install)([`${pluginName}@latest`]); - await hooks.aCallAll('pluginInstall', {pluginName}); - await plugins.update(); } catch (err) { cb(err || new Error(err)); throw err; } + await hooks.aCallAll('pluginInstall', {pluginName}); + await plugins.update(); cb(null); };