From 130f9443986504788aecaee23f860523cbe2a64b Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Date: Thu, 19 Nov 2020 10:14:43 +0100 Subject: [PATCH] :zap: Catch workflowExecuteAfter hook (#1189) --- packages/core/src/WorkflowExecute.ts | 4 +++- packages/workflow/src/WorkflowHooks.ts | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index 4ed49770a3..c08ea2a020 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -761,7 +761,9 @@ export class WorkflowExecute { newStaticData = workflow.staticData; } - await this.executeHook('workflowExecuteAfter', [fullRunData, newStaticData]); + await this.executeHook('workflowExecuteAfter', [fullRunData, newStaticData]).catch(error => { + console.error('There was a problem running hook "workflowExecuteAfter"', error); + }); return fullRunData; }); diff --git a/packages/workflow/src/WorkflowHooks.ts b/packages/workflow/src/WorkflowHooks.ts index 92efb468a0..6356605bdc 100644 --- a/packages/workflow/src/WorkflowHooks.ts +++ b/packages/workflow/src/WorkflowHooks.ts @@ -28,8 +28,6 @@ export class WorkflowHooks { async executeHookFunctions(hookName: string, parameters: any[]) { // tslint:disable-line:no-any if (this.hookFunctions[hookName] !== undefined && Array.isArray(this.hookFunctions[hookName])) { for (const hookFunction of this.hookFunctions[hookName]!) { - // TODO: As catch got removed we should make sure that we catch errors - // where hooks get called await hookFunction.apply(this, parameters); } }