add some more trycatch for external code calls
This commit is contained in:
parent
6640fa1890
commit
4362d39624
|
@ -191,13 +191,21 @@ class PluginManager extends Module {
|
||||||
|
|
||||||
stopPlugin(name) {
|
stopPlugin(name) {
|
||||||
const plugin = this.getPluginByName(name);
|
const plugin = this.getPluginByName(name);
|
||||||
|
try {
|
||||||
if (plugin && plugin.instance) return plugin.instance.stop();
|
if (plugin && plugin.instance) return plugin.instance.stop();
|
||||||
|
} catch (err) {
|
||||||
|
Logger.err('PluginManager', err);
|
||||||
|
}
|
||||||
return true; //Return true anyways since plugin doesn't exist
|
return true; //Return true anyways since plugin doesn't exist
|
||||||
}
|
}
|
||||||
|
|
||||||
startPlugin(name) {
|
startPlugin(name) {
|
||||||
const plugin = this.getPluginByName(name);
|
const plugin = this.getPluginByName(name);
|
||||||
|
try {
|
||||||
if (plugin && plugin.instance) return plugin.instance.start();
|
if (plugin && plugin.instance) return plugin.instance.start();
|
||||||
|
} catch (err) {
|
||||||
|
Logger.err('PluginManager', err);
|
||||||
|
}
|
||||||
return true; //Return true anyways since plugin doesn't exist
|
return true; //Return true anyways since plugin doesn't exist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue