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:
@@ -23,13 +23,13 @@ export async function upload(this: IExecuteFunctions, index: number) {
|
||||
const share = this.getNodeParameter('options.share', index, true) as boolean;
|
||||
|
||||
if (items[index].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: index });
|
||||
}
|
||||
|
||||
const propertyNameUpload = this.getNodeParameter('binaryPropertyName', index) as string;
|
||||
|
||||
if (items[index]!.binary![propertyNameUpload] === undefined) {
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${propertyNameUpload}" does not exists on item!`);
|
||||
throw new NodeOperationError(this.getNode(), `No binary data property "${propertyNameUpload}" does not exists on item!`, { itemIndex: index });
|
||||
}
|
||||
|
||||
const item = items[index].binary as IBinaryKeyData;
|
||||
@@ -55,7 +55,7 @@ export async function upload(this: IExecuteFunctions, index: number) {
|
||||
};
|
||||
|
||||
Object.assign(body.formData, (share) ? { share: 'yes' } : { share: 'no' });
|
||||
|
||||
|
||||
//endpoint
|
||||
const endpoint = `files`;
|
||||
const { headers } = await apiRequest.call(this, requestMethod, endpoint, {}, {}, body);
|
||||
|
||||
Reference in New Issue
Block a user