mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
plugins: Move hook call and plugin update out of try block
Exceptions thrown by these function calls are serious and should crash Etherpad.
This commit is contained in:
parent
a8479e4a0e
commit
4253a2ea8f
1 changed files with 4 additions and 4 deletions
|
@ -36,12 +36,12 @@ exports.uninstall = async (pluginName, cb = null) => {
|
||||||
try {
|
try {
|
||||||
await loadNpm();
|
await loadNpm();
|
||||||
await util.promisify(npm.commands.uninstall)([pluginName]);
|
await util.promisify(npm.commands.uninstall)([pluginName]);
|
||||||
await hooks.aCallAll('pluginUninstall', {pluginName});
|
|
||||||
await plugins.update();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
cb(err || new Error(err));
|
cb(err || new Error(err));
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
await hooks.aCallAll('pluginUninstall', {pluginName});
|
||||||
|
await plugins.update();
|
||||||
cb(null);
|
cb(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,12 +50,12 @@ exports.install = async (pluginName, cb = null) => {
|
||||||
try {
|
try {
|
||||||
await loadNpm();
|
await loadNpm();
|
||||||
await util.promisify(npm.commands.install)([`${pluginName}@latest`]);
|
await util.promisify(npm.commands.install)([`${pluginName}@latest`]);
|
||||||
await hooks.aCallAll('pluginInstall', {pluginName});
|
|
||||||
await plugins.update();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
cb(err || new Error(err));
|
cb(err || new Error(err));
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
await hooks.aCallAll('pluginInstall', {pluginName});
|
||||||
|
await plugins.update();
|
||||||
cb(null);
|
cb(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue