mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
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
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { INode } from '..';
|
||||
import type { INode, JsonObject } from '..';
|
||||
import type { NodeOperationErrorOptions } from './node-api.error';
|
||||
import { NodeError } from './abstract/node.error';
|
||||
|
||||
@@ -8,7 +8,11 @@ import { NodeError } from './abstract/node.error';
|
||||
export class NodeOperationError extends NodeError {
|
||||
lineNumber: number | undefined;
|
||||
|
||||
constructor(node: INode, error: Error | string, options: NodeOperationErrorOptions = {}) {
|
||||
constructor(
|
||||
node: INode,
|
||||
error: Error | string | JsonObject,
|
||||
options: NodeOperationErrorOptions = {},
|
||||
) {
|
||||
if (typeof error === 'string') {
|
||||
error = new Error(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user