feat(core): Run Error Workflow also on trigger activation error (#3470)

* feat(core): Run Error Workflow also when workflow gets deactivated
or could not be activated on startup because of error
R#

*  Add missing file
This commit is contained in:
Jan Oberhauser
2022-06-06 09:17:35 +02:00
committed by GitHub
parent ff95de0bdd
commit b5535e4a62
6 changed files with 97 additions and 27 deletions

View File

@@ -9,6 +9,7 @@ import { URLSearchParams } from 'url';
import { IDeferredPromise } from './DeferredPromise';
import { Workflow } from './Workflow';
import { WorkflowHooks } from './WorkflowHooks';
import { WorkflowActivationError } from './WorkflowActivationError';
import { WorkflowOperationError } from './WorkflowErrors';
import { NodeApiError, NodeOperationError } from './NodeErrors';
@@ -56,7 +57,11 @@ export interface IConnection {
index: number;
}
export type ExecutionError = WorkflowOperationError | NodeOperationError | NodeApiError;
export type ExecutionError =
| WorkflowActivationError
| WorkflowOperationError
| NodeOperationError
| NodeApiError;
// Get used to gives nodes access to credentials
export interface IGetCredentials {

View File

@@ -0,0 +1,16 @@
// eslint-disable-next-line import/no-cycle
import { ExecutionBaseError, INode } from '.';
/**
* Class for instantiating an workflow activation error
*/
export class WorkflowActivationError extends ExecutionBaseError {
node: INode | undefined;
constructor(message: string, error: Error, node?: INode) {
super(error);
this.node = node;
this.cause = error;
this.message = message;
}
}

View File

@@ -11,6 +11,7 @@ export * from './NodeErrors';
export * as TelemetryHelpers from './TelemetryHelpers';
export * from './RoutingNode';
export * from './Workflow';
export * from './WorkflowActivationError';
export * from './WorkflowDataProxy';
export * from './WorkflowErrors';
export * from './WorkflowHooks';