mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +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:
@@ -434,7 +434,7 @@ export class ActiveCampaign implements INodeType {
|
||||
addAdditionalFields(body.contact as IDataObject, updateFields);
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'account') {
|
||||
if (operation === 'create') {
|
||||
@@ -515,7 +515,7 @@ export class ActiveCampaign implements INodeType {
|
||||
addAdditionalFields(body.account as IDataObject, updateFields);
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'accountContact') {
|
||||
if (operation === 'create') {
|
||||
@@ -565,7 +565,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/accountContacts/${accountContactId}`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'contactTag') {
|
||||
if (operation === 'add') {
|
||||
@@ -595,7 +595,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/contactTags/${contactTagId}`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'contactList') {
|
||||
if (operation === 'add') {
|
||||
@@ -633,7 +633,7 @@ export class ActiveCampaign implements INodeType {
|
||||
dataKey = 'contacts';
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'list') {
|
||||
if (operation === 'getAll') {
|
||||
@@ -735,7 +735,7 @@ export class ActiveCampaign implements INodeType {
|
||||
addAdditionalFields(body.tag as IDataObject, updateFields);
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'deal') {
|
||||
if (operation === 'create') {
|
||||
@@ -854,7 +854,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/deals/${dealId}/notes/${dealNoteId}`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'connection') {
|
||||
if (operation === 'create') {
|
||||
@@ -929,7 +929,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/connections`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'ecommerceOrder') {
|
||||
if (operation === 'create') {
|
||||
@@ -1027,7 +1027,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/ecomOrders`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'ecommerceCustomer') {
|
||||
if (operation === 'create') {
|
||||
@@ -1117,7 +1117,7 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/ecomCustomers`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
} else if (resource === 'ecommerceOrderProducts') {
|
||||
if (operation === 'getByProductId') {
|
||||
@@ -1163,11 +1163,11 @@ export class ActiveCampaign implements INodeType {
|
||||
endpoint = `/api/3/ecomOrderProducts`;
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`);
|
||||
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not known`, { itemIndex: i });
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`);
|
||||
throw new NodeOperationError(this.getNode(), `The resource "${resource}" is not known!`, { itemIndex: i });
|
||||
}
|
||||
|
||||
let responseData;
|
||||
|
||||
Reference in New Issue
Block a user