move catch before finally

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-09-18 14:09:23 +02:00
parent 5ecfae6320
commit 912c94e541
No known key found for this signature in database
GPG key ID: 9300FF7CDEA1FBAA

View file

@ -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;