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

@@ -225,7 +225,7 @@ export class Trello implements INodeType {
Object.assign(qs, 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 === 'boardMember') {
if (operation === 'getAll') {
@@ -287,7 +287,7 @@ export class Trello implements INodeType {
endpoint = `boards/${id}/members/${idMember}`;
} 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 === 'card') {
@@ -347,7 +347,7 @@ export class Trello implements INodeType {
Object.assign(qs, 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 === 'cardComment') {
@@ -395,7 +395,7 @@ export class Trello implements INodeType {
endpoint = `cards/${cardId}/actions/${commentId}/comments`;
} 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') {
@@ -496,7 +496,7 @@ export class Trello implements INodeType {
Object.assign(qs, 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 === 'attachment') {
@@ -561,7 +561,7 @@ export class Trello implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
Object.assign(qs, additionalFields);
} 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 === 'checklist') {
@@ -695,7 +695,7 @@ export class Trello implements INodeType {
Object.assign(qs, additionalFields);
} 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 === 'label') {
@@ -798,10 +798,10 @@ export class Trello implements INodeType {
endpoint = `/cards/${cardId}/idLabels/${id}`;
} 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 });
}