mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
remove isAbortError
This commit is contained in:
parent
18da8e0b8f
commit
301b1366d9
|
@ -155,10 +155,6 @@ export class WorkflowExecute {
|
|||
return this.processRunExecutionData(workflow);
|
||||
}
|
||||
|
||||
static isAbortError(e?: Error) {
|
||||
return e?.name === 'AbortError' || e instanceof ExecutionCancelledError;
|
||||
}
|
||||
|
||||
forceInputNodeExecution(workflow: Workflow): boolean {
|
||||
return workflow.settings.executionOrder !== 'v1';
|
||||
}
|
||||
|
@ -1480,7 +1476,7 @@ export class WorkflowExecute {
|
|||
// Add the execution data again so that it can get restarted
|
||||
this.runExecutionData.executionData!.nodeExecutionStack.unshift(executionData);
|
||||
// Only execute the nodeExecuteAfter hook if the node did not get aborted
|
||||
if (!WorkflowExecute.isAbortError(executionError)) {
|
||||
if (!this.isCancelled) {
|
||||
await this.executeHook('nodeExecuteAfter', [
|
||||
executionNode.name,
|
||||
taskData,
|
||||
|
@ -1929,7 +1925,7 @@ export class WorkflowExecute {
|
|||
|
||||
this.moveNodeMetadata();
|
||||
// Prevent from running the hook if the error is an abort error as it was already handled
|
||||
if (!WorkflowExecute.isAbortError(executionError)) {
|
||||
if (!this.isCancelled) {
|
||||
await this.executeHook('workflowExecuteAfter', [fullRunData, newStaticData]);
|
||||
}
|
||||
|
||||
|
@ -1960,4 +1956,8 @@ export class WorkflowExecute {
|
|||
|
||||
return fullRunData;
|
||||
}
|
||||
|
||||
private get isCancelled() {
|
||||
return this.abortController.signal.aborted;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,8 @@ import type { IRun, WorkflowTestData } from 'n8n-workflow';
|
|||
import {
|
||||
ApplicationError,
|
||||
createDeferredPromise,
|
||||
ExecutionCancelledError,
|
||||
NodeExecutionOutput,
|
||||
Workflow,
|
||||
WorkflowOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { WorkflowExecute } from '@/WorkflowExecute';
|
||||
|
@ -215,20 +213,4 @@ describe('WorkflowExecute', () => {
|
|||
expect(nodeExecutionOutput[0][0].json.data).toEqual(123);
|
||||
expect(nodeExecutionOutput.getHints()[0].message).toEqual('TEXT HINT');
|
||||
});
|
||||
|
||||
describe('isAbortError', () => {
|
||||
test.each([
|
||||
['AbortError', new DOMException('', 'AbortError')],
|
||||
['WorkflowOperationError', new ExecutionCancelledError('1234')],
|
||||
])('returns true when passed a %s', (_name, error) => {
|
||||
expect(WorkflowExecute.isAbortError(error)).toBe(true);
|
||||
});
|
||||
|
||||
test.each([
|
||||
['TypeError', new TypeError()],
|
||||
['WorkflowOperationError', new WorkflowOperationError('test')],
|
||||
])('returns false when passed a %s', (_name, error) => {
|
||||
expect(WorkflowExecute.isAbortError(error)).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue