mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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:
@@ -204,7 +204,7 @@ export class HelpScout implements INodeType {
|
||||
delete body.customerEmail;
|
||||
}
|
||||
if (body.customer === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'Either customer email or customer ID must be set');
|
||||
throw new NodeOperationError(this.getNode(), 'Either customer email or customer ID must be set', { itemIndex: i });
|
||||
}
|
||||
if (threads) {
|
||||
for (let i = 0; i < threads.length; i++) {
|
||||
@@ -290,7 +290,7 @@ export class HelpScout implements INodeType {
|
||||
body.websites = websites;
|
||||
}
|
||||
if (Object.keys(body).length === 0) {
|
||||
throw new NodeOperationError(this.getNode(), 'You have to set at least one field');
|
||||
throw new NodeOperationError(this.getNode(), 'You have to set at least one field', { itemIndex: i });
|
||||
}
|
||||
responseData = await helpscoutApiRequest.call(this, 'POST', '/v2/customers', body, qs, undefined, { resolveWithFullResponse: true });
|
||||
const id = responseData.headers['resource-id'];
|
||||
@@ -336,7 +336,7 @@ export class HelpScout implements INodeType {
|
||||
body.age = body.age.toString();
|
||||
}
|
||||
if (Object.keys(body).length === 0) {
|
||||
throw new NodeOperationError(this.getNode(), 'You have to set at least one field');
|
||||
throw new NodeOperationError(this.getNode(), 'You have to set at least one field', { itemIndex: i });
|
||||
}
|
||||
responseData = await helpscoutApiRequest.call(this, 'PUT', `/v2/customers/${customerId}`, body, qs, undefined, { resolveWithFullResponse: true });
|
||||
responseData = { success: true };
|
||||
@@ -388,7 +388,7 @@ export class HelpScout implements INodeType {
|
||||
delete body.customerEmail;
|
||||
}
|
||||
if (body.customer === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), 'Either customer email or customer ID must be set');
|
||||
throw new NodeOperationError(this.getNode(), 'Either customer email or customer ID must be set', { itemIndex: i });
|
||||
}
|
||||
if (attachments) {
|
||||
if (attachments.attachmentsValues
|
||||
@@ -407,7 +407,7 @@ export class HelpScout implements INodeType {
|
||||
mimeType: binaryProperty.mimeType,
|
||||
};
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `Binary property ${value.property} does not exist on input`);
|
||||
throw new NodeOperationError(this.getNode(), `Binary property ${value.property} does not exist on input`, { itemIndex: i });
|
||||
}
|
||||
};
|
||||
body.attachments?.push.apply(body.attachments, (attachments.attachmentsBinary as IDataObject[]).map(mapFunction) as IAttachment[]);
|
||||
|
||||
Reference in New Issue
Block a user