From 912c94e541fd2cb40f0146fb7e67c7331431ad6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 18 Sep 2024 14:09:23 +0200 Subject: [PATCH] move catch before finally --- packages/cli/src/active-executions.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/active-executions.ts b/packages/cli/src/active-executions.ts index 6ce62da079..86f77503a8 100644 --- a/packages/cli/src/active-executions.ts +++ b/packages/cli/src/active-executions.ts @@ -107,13 +107,13 @@ export class ActiveExecutions { // Automatically remove execution once the postExecutePromise settles void postExecutePromise.promise + .catch((error) => { + // rethrow the error unless it's ExecutionCancelledError + if (!(error instanceof ExecutionCancelledError)) throw error; + }) .finally(() => { this.concurrencyControl.release({ mode: executionData.executionMode }); delete this.activeExecutions[executionId]; - }) - // Do not throw ExecutionCancelledError - .catch((error) => { - if (!(error instanceof ExecutionCancelledError)) throw error; }); return executionId;