File tree Expand file tree Collapse file tree 4 files changed +43
-1
lines changed
editor-ui/src/plugins/i18n/locales Expand file tree Collapse file tree 4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { ApplicationError } from 'n8n-workflow' ;
2
+
3
+ export class AbortedExecutionRetryError extends ApplicationError {
4
+ constructor ( ) {
5
+ super ( 'The execution was aborted before starting, so it cannot be retried' , {
6
+ level : 'warning' ,
7
+ } ) ;
8
+ }
9
+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import { NotFoundError } from '@/errors/response-errors/not-found.error';
36
36
import config from '@/config' ;
37
37
import { WaitTracker } from '@/WaitTracker' ;
38
38
import type { ExecutionEntity } from '@/databases/entities/ExecutionEntity' ;
39
+ import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error' ;
39
40
40
41
export const schemaGetExecutionsQueryFilter = {
41
42
$id : '/IGetExecutionsQueryFilter' ,
@@ -129,6 +130,8 @@ export class ExecutionService {
129
130
throw new NotFoundError ( `The execution with the ID "${ executionId } " does not exist.` ) ;
130
131
}
131
132
133
+ if ( ! execution . data . executionData ) throw new AbortedExecutionRetryError ( ) ;
134
+
132
135
if ( execution . finished ) {
133
136
throw new ApplicationError ( 'The execution succeeded, so it cannot be retried.' ) ;
134
137
}
Original file line number Diff line number Diff line change
1
+ import type { IExecutionResponse } from '@/Interfaces' ;
2
+ import type { ExecutionRepository } from '@/databases/repositories/execution.repository' ;
3
+ import { AbortedExecutionRetryError } from '@/errors/aborted-execution-retry.error' ;
4
+ import { ExecutionService } from '@/executions/execution.service' ;
5
+ import type { ExecutionRequest } from '@/executions/execution.types' ;
6
+ import { mock } from 'jest-mock-extended' ;
7
+
8
+ describe ( 'ExecutionService' , ( ) => {
9
+ const executionRepository = mock < ExecutionRepository > ( ) ;
10
+ const executionService = new ExecutionService (
11
+ mock ( ) ,
12
+ mock ( ) ,
13
+ mock ( ) ,
14
+ executionRepository ,
15
+ mock ( ) ,
16
+ mock ( ) ,
17
+ mock ( ) ,
18
+ mock ( ) ,
19
+ ) ;
20
+
21
+ it ( 'should error on retrying an aborted execution' , async ( ) => {
22
+ const abortedExecutionData = mock < IExecutionResponse > ( { data : { executionData : undefined } } ) ;
23
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( abortedExecutionData ) ;
24
+ const req = mock < ExecutionRequest . Retry > ( ) ;
25
+
26
+ const retry = executionService . retry ( req , [ ] ) ;
27
+
28
+ await expect ( retry ) . rejects . toThrow ( AbortedExecutionRetryError ) ;
29
+ } ) ;
30
+ } ) ;
Original file line number Diff line number Diff line change 1218
1218
"nodeView.runButtonText.executeWorkflow" : " Test workflow" ,
1219
1219
"nodeView.runButtonText.executingWorkflow" : " Executing workflow" ,
1220
1220
"nodeView.runButtonText.waitingForTriggerEvent" : " Waiting for trigger event" ,
1221
- "nodeView.showError.workflowError" : " Workflow execution finished with an error" ,
1221
+ "nodeView.showError.workflowError" : " Workflow execution had an error" ,
1222
1222
"nodeView.showError.getWorkflowDataFromUrl.title" : " Problem loading workflow" ,
1223
1223
"nodeView.showError.importWorkflowData.title" : " Problem importing workflow" ,
1224
1224
"nodeView.showError.mounted1.message" : " There was a problem loading init data" ,
You can’t perform that action at this time.
0 commit comments