From c239eea1b9fc7c7397db8135528ac0d136be1c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 7 Nov 2022 18:40:54 +0100 Subject: [PATCH] fix(HTTP Request Node): Show error cause in the output (#4538) fix (HTTP Request node): show error cause in the output This broke in these two PRs https://github.com/n8n-io/n8n/pull/4505/ https://github.com/n8n-io/n8n/pull/4431/ --- packages/workflow/src/NodeErrors.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/workflow/src/NodeErrors.ts b/packages/workflow/src/NodeErrors.ts index 834111088..e405b389a 100644 --- a/packages/workflow/src/NodeErrors.ts +++ b/packages/workflow/src/NodeErrors.ts @@ -63,6 +63,8 @@ interface ExecutionBaseErrorOptions { export abstract class ExecutionBaseError extends Error { description: string | null | undefined; + cause: Error | JsonObject | undefined; + timestamp: number; context: IDataObject = {}; @@ -78,6 +80,8 @@ export abstract class ExecutionBaseError extends Error { if (cause instanceof ExecutionBaseError) { this.context = cause.context; + } else if (cause && !(cause instanceof Error)) { + this.cause = cause; } } } @@ -179,7 +183,6 @@ abstract class NodeError extends ExecutionBaseError { value && typeof value === 'object' && !Array.isArray(value) && - typeof value.toJSON !== 'function' && // eslint-disable-next-line @typescript-eslint/no-unsafe-argument !!Object.keys(value).length );