n8n/packages/workflow/src/WorkflowErrors.ts
Omar Ajoue 87996a1fcf
refactor(core): Stop reporting non-error to sentry (issue 4229454473) (no-changelog) (#7525)
This PR aims to stop reporting issues such as [this
one](https://n8nio.sentry.io/issues/4229454473/events/42b96bfd6a334c15a84499e981cf90eb/?project=4503924908883968).

Github issue / Community forum post (link here to close automatically):
2023-10-27 09:25:07 +02:00

43 lines
993 B
TypeScript

import type { INode } from './Interfaces';
import { ExecutionBaseError } from './NodeErrors';
/**
* Class for instantiating an operational error, e.g. a timeout error.
*/
export class WorkflowOperationError extends ExecutionBaseError {
node: INode | undefined;
timestamp: number;
lineNumber: number | undefined;
description: string | undefined;
constructor(message: string, node?: INode) {
super(message, { cause: undefined });
this.severity = 'warning';
this.name = this.constructor.name;
this.node = node;
this.timestamp = Date.now();
}
}
export class SubworkflowOperationError extends WorkflowOperationError {
description = '';
cause: { message: string; stack: string };
constructor(message: string, description: string) {
super(message);
this.name = this.constructor.name;
this.description = description;
this.cause = {
message,
stack: this.stack as string,
};
}
}
export class CliWorkflowOperationError extends SubworkflowOperationError {}