feat(core): Improve paired item and add additional variables (#3765)

*  Remove duplicate and old string

*  Add telemetry

*  Futher improvements

*  Change error message and display only name of last parameter

* 👕 Fix lint issue

*  Remove not needed comments

*  Rename properties, add new ones and improve error messages

*  Add support for $execution, $prevNode and make it possible to use proxies as object

*  Some small improvements

* 🐛 Fix error message

*  Improve some error messages

*  Change resumeUrl variable and display in editor

*  Fix and extend tests

*  Multiple pairedItem improvements

*  Display "More Info" link with error messages if user can fix issue

*  Display different errors in Function Nodes
This commit is contained in:
Jan Oberhauser
2022-09-29 23:02:25 +02:00
committed by GitHub
parent 737cbf9694
commit 5526057efc
15 changed files with 684 additions and 301 deletions

View File

@@ -1,3 +1,5 @@
/* eslint-disable import/no-cycle */
import { IDataObject } from './Interfaces';
import { ExecutionBaseError } from './NodeErrors';
/**
@@ -10,11 +12,14 @@ export class ExpressionError extends ExecutionBaseError {
causeDetailed?: string;
description?: string;
descriptionTemplate?: string;
runIndex?: number;
failExecution?: boolean;
functionality?: 'pairedItem';
itemIndex?: number;
messageTemplate?: string;
nodeCause?: string;
parameter?: string;
failExecution?: boolean;
runIndex?: number;
type?: string;
},
) {
super(new Error(message));
@@ -23,30 +28,25 @@ export class ExpressionError extends ExecutionBaseError {
this.description = options.description;
}
if (options?.descriptionTemplate !== undefined) {
this.context.descriptionTemplate = options.descriptionTemplate;
}
if (options?.causeDetailed !== undefined) {
this.context.causeDetailed = options.causeDetailed;
}
if (options?.runIndex !== undefined) {
this.context.runIndex = options.runIndex;
}
if (options?.itemIndex !== undefined) {
this.context.itemIndex = options.itemIndex;
}
if (options?.parameter !== undefined) {
this.context.parameter = options.parameter;
}
if (options?.messageTemplate !== undefined) {
this.context.messageTemplate = options.messageTemplate;
}
this.context.failExecution = !!options?.failExecution;
const allowedKeys = [
'causeDetailed',
'descriptionTemplate',
'functionality',
'itemIndex',
'messageTemplate',
'nodeCause',
'parameter',
'runIndex',
'type',
];
if (options !== undefined) {
Object.keys(options as IDataObject).forEach((key) => {
if (allowedKeys.includes(key)) {
this.context[key] = (options as IDataObject)[key];
}
});
}
}
}