mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -712,7 +712,7 @@ export class Keap implements INodeType {
|
||||
&& (attachmentsUi.attachmentsBinary as IDataObject).length) {
|
||||
|
||||
if (items[i].binary === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!');
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
|
||||
}
|
||||
|
||||
for (const { property } of attachmentsUi.attachmentsBinary as IDataObject[]) {
|
||||
@@ -720,7 +720,7 @@ export class Keap implements INodeType {
|
||||
const item = items[i].binary as IBinaryKeyData;
|
||||
|
||||
if (item[property as string] === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), `Binary data property "${property}" does not exists on item!`);
|
||||
throw new NodeOperationError(this.getNode(), `Binary data property "${property}" does not exists on item!`, { itemIndex: i });
|
||||
}
|
||||
|
||||
attachments.push({
|
||||
@@ -783,13 +783,13 @@ export class Keap implements INodeType {
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i) as string;
|
||||
|
||||
if (items[i].binary === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!');
|
||||
throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i });
|
||||
}
|
||||
|
||||
const item = items[i].binary as IBinaryKeyData;
|
||||
|
||||
if (item[binaryPropertyName as string] === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`);
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i });
|
||||
}
|
||||
|
||||
body.file_data = item[binaryPropertyName as string].data;
|
||||
|
||||
Reference in New Issue
Block a user