From 9fa6ca160a9dda057c3980c6ee19f0ee426fd0a0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jul 2019 15:46:51 +0200 Subject: Some plugins fixes and doc enhancements --- client/src/app/core/plugins/plugin.service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 525740a01..af330c2eb 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts @@ -125,8 +125,15 @@ export class PluginService { for (const hook of this.hooks[hookName]) { try { - if (wait) result = await hook.handler(param) - else result = hook.handler() + const p = hook.handler(param) + + if (wait) { + result = await p + } else if (p.catch) { + p.catch((err: Error) => { + console.error('Cannot run hook %s of script %s of plugin %s.', hookName, hook.plugin, hook.clientScript, err) + }) + } } catch (err) { console.error('Cannot run hook %s of script %s of plugin %s.', hookName, hook.plugin, hook.clientScript, err) } -- cgit v1.2.3