Files
Automata/packages/workflow/src/errors/subworkflow-operation.error.ts
Iván Ovejero e0b7f89035 refactor(core): Separate API response from error in execution error causes (no-changelog) (#7880)
Store the third-party API response error separately from the error
stored as `cause`

Follow-up to:
https://github.com/n8n-io/n8n/pull/7820#discussion_r1406009154
2023-11-30 14:44:10 +01:00

20 lines
412 B
TypeScript

import { WorkflowOperationError } from './workflow-operation.error';
export class SubworkflowOperationError extends WorkflowOperationError {
description = '';
cause: Error;
constructor(message: string, description: string) {
super(message);
this.name = this.constructor.name;
this.description = description;
this.cause = {
name: this.name,
message,
stack: this.stack as string,
};
}
}