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
20 lines
412 B
TypeScript
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,
|
|
};
|
|
}
|
|
}
|