diff --git a/packages/cli/commands/worker.ts b/packages/cli/commands/worker.ts index 424d5c71b0..cf07c190d3 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; } }); diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 495a37c6f7..cc3b0d7fca 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; }