From f1d0f3002a89a3760cc4b8cbf23c6d0238e262e4 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Thu, 10 Mar 2022 20:56:09 -0800 Subject: [PATCH] added try catch --- src/main/base/plugins.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/base/plugins.ts b/src/main/base/plugins.ts index 7ccfcefa..1f501cd2 100644 --- a/src/main/base/plugins.ts +++ b/src/main/base/plugins.ts @@ -104,7 +104,11 @@ export class Plugins { public callPlugins(event: string, ...args: any[]) { for (const plugin in this.pluginsList) { if (this.pluginsList[plugin][event]) { - this.pluginsList[plugin][event](...args); + try{ + this.pluginsList[plugin][event](...args); + }catch(e) { + console.log(`[${plugin}] Plugin error: ${e}`); + } } } }