feat: Add item information to more node errors (#3681)

*  Add `itemIndex` to node-thrown errors

*  Add some missing item indexes
This commit is contained in:
Iván Ovejero
2022-07-12 17:51:01 +02:00
committed by GitHub
parent a847190f33
commit 2a8043cd27
117 changed files with 376 additions and 370 deletions

View File

@@ -125,7 +125,7 @@ export class Iterable implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
if (!additionalFields.email && !additionalFields.id) {
throw new NodeOperationError(this.getNode(), 'Either email or userId must be passed in to identify the user. Please add one of both via "Additional Fields". If both are passed in, email takes precedence.');
throw new NodeOperationError(this.getNode(), 'Either email or userId must be passed in to identify the user. Please add one of both via "Additional Fields". If both are passed in, email takes precedence.', { itemIndex: i });
}
const body: IDataObject = {
@@ -194,7 +194,7 @@ export class Iterable implements INodeType {
if (this.continueOnFail() === false) {
if (responseData.code !== 'Success') {
throw new NodeOperationError(this.getNode(),
`Iterable error response [400]: ${responseData.msg}`,
`Iterable error response [400]: ${responseData.msg}`, { itemIndex: i }
);
}
}