feat(core): Add a warning to error workflows that cannot be started due to permission or settings (#6961)

Github issue / Community forum post (link here to close automatically):

This PR aims to address an issue where an Error workflow cannot be
started, either due to insufficient permissions or because its settings
prevent it from being called.

The way of addressing this is by creating a failed execution for the
appointed error workflow stating the error, as can be seen below.

This means the execution itself won't start, as it's prevented before
the execution beings, but we save a "stub" execution to show the error.

![Screenshot 2023-08-17 at 16 17
02](https://github.com/n8n-io/n8n/assets/219272/d8ec0144-13c5-4b11-b91c-a6b440816ccf)
This commit is contained in:
Omar Ajoue
2023-08-22 15:26:33 +02:00
committed by GitHub
parent c188b0e9b2
commit 67b88f75f4
3 changed files with 85 additions and 56 deletions

View File

@@ -1,9 +1,10 @@
import type { INode } from './Interfaces';
import { ExecutionBaseError } from './NodeErrors';
/**
* Class for instantiating an operational error, e.g. a timeout error.
*/
export class WorkflowOperationError extends Error {
export class WorkflowOperationError extends ExecutionBaseError {
node: INode | undefined;
timestamp: number;
@@ -13,7 +14,7 @@ export class WorkflowOperationError extends Error {
description: string | undefined;
constructor(message: string, node?: INode) {
super(message);
super(message, { cause: undefined });
this.name = this.constructor.name;
this.node = node;
this.timestamp = Date.now();