From ef2653948e4c321fb69c027b45630314119a7101 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Mon, 30 May 2022 17:21:12 +0200 Subject: [PATCH 1/2] Add catch block to avoid crashes when running in queue mode --- packages/cli/src/WorkflowRunner.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 495a37c6f75b2..cc3b0d7fcabf2 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -561,6 +561,12 @@ export class WorkflowRunner { }, ); + workflowExecution.catch(() => { + // We `reject` this promise if the execution fails + // but the error is handled already by processError + // So we're just preventing crashes here. + }); + this.activeExecutions.attachWorkflowExecution(executionId, workflowExecution); return executionId; } From d46fbfe821297f0522b5466f2f6bc73673a7d0a8 Mon Sep 17 00:00:00 2001 From: Omar Ajoue Date: Wed, 1 Jun 2022 09:17:26 +0200 Subject: [PATCH 2/2] Throwing errors that happen in worker so process stops --- packages/cli/commands/worker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/commands/worker.ts b/packages/cli/commands/worker.ts index 424d5c71b0a0e..cf07c190d3647 100644 --- a/packages/cli/commands/worker.ts +++ b/packages/cli/commands/worker.ts @@ -354,6 +354,7 @@ export class Worker extends Command { process.exit(2); } else { logger.error('Error from queue: ', error); + throw error; } });