fix(core): Account for retry of execution aborted by pre-execute hook (#9474)
This commit is contained in:
9
packages/cli/src/errors/aborted-execution-retry.error.ts
Normal file
9
packages/cli/src/errors/aborted-execution-retry.error.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ApplicationError } from 'n8n-workflow';
|
||||
|
||||
export class AbortedExecutionRetryError extends ApplicationError {
|
||||
constructor() {
|
||||
super('The execution was aborted before starting, so it cannot be retried', {
|
||||
level: 'warning',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
|
||||
import config from '@/config';
|
||||
import { WaitTracker } from '@/WaitTracker';
|
||||
import type { ExecutionEntity } from '@/databases/entities/ExecutionEntity';
|
||||
import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error';
|
||||
|
||||
export const schemaGetExecutionsQueryFilter = {
|
||||
$id: '/IGetExecutionsQueryFilter',
|
||||
@@ -129,6 +130,8 @@ export class ExecutionService {
|
||||
throw new NotFoundError(`The execution with the ID "${executionId}" does not exist.`);
|
||||
}
|
||||
|
||||
if (!execution.data.executionData) throw new AbortedExecutionRetryError();
|
||||
|
||||
if (execution.finished) {
|
||||
throw new ApplicationError('The execution succeeded, so it cannot be retried.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user