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:
@@ -556,7 +556,7 @@ export class ServiceNow implements INodeType {
|
||||
if (items[i].binary && items[i].binary![inputDataFieldName]) {
|
||||
binaryData = items[i].binary![inputDataFieldName];
|
||||
} else {
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${inputDataFieldName}" does not exists on item!`);
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${inputDataFieldName}" does not exists on item!`, { itemIndex: i });
|
||||
}
|
||||
|
||||
const headers: IDataObject = {
|
||||
@@ -722,7 +722,7 @@ export class ServiceNow implements INodeType {
|
||||
responseData = response.result;
|
||||
|
||||
} 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 === 'tableRecord') {
|
||||
|
||||
@@ -816,7 +816,7 @@ export class ServiceNow implements INodeType {
|
||||
responseData = response.result;
|
||||
|
||||
} 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 === 'user') {
|
||||
|
||||
@@ -881,7 +881,7 @@ export class ServiceNow implements INodeType {
|
||||
responseData = response.result;
|
||||
|
||||
} 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 === 'userGroup') {
|
||||
if (operation === 'getAll') {
|
||||
@@ -902,7 +902,7 @@ export class ServiceNow implements INodeType {
|
||||
responseData = await serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_group', {}, qs);
|
||||
}
|
||||
} 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 === 'userRole') {
|
||||
if (operation === 'getAll') {
|
||||
@@ -923,10 +923,10 @@ export class ServiceNow implements INodeType {
|
||||
responseData = await serviceNowRequestAllItems.call(this, 'GET', '/now/table/sys_user_role', {}, qs);
|
||||
}
|
||||
} 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 });
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.continueOnFail()) {
|
||||
|
||||
Reference in New Issue
Block a user