From 57025a7b79d9a52382a7cc070bce69653cd677b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Tue, 31 Aug 2021 10:49:55 +0200 Subject: [PATCH] :zap: Add description to NodeOperationError (#2148) --- packages/workflow/src/NodeErrors.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/workflow/src/NodeErrors.ts b/packages/workflow/src/NodeErrors.ts index 9754b8f85d..33a591b5fc 100644 --- a/packages/workflow/src/NodeErrors.ts +++ b/packages/workflow/src/NodeErrors.ts @@ -202,11 +202,15 @@ abstract class NodeError extends Error { * Class for instantiating an operational error, e.g. an invalid credentials error. */ export class NodeOperationError extends NodeError { - constructor(node: INode, error: Error | string) { + constructor(node: INode, error: Error | string, options?: { description: string }) { if (typeof error === 'string') { error = new Error(error); } super(node, error); + + if (options?.description) { + this.description = options.description; + } } }