mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(core): Improvements/overhaul for nodes working with binary data (#7651)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Giulio Andreini <andreini@netseven.it> Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
@@ -987,16 +987,27 @@ export function assertBinaryData(
|
||||
): IBinaryData {
|
||||
const binaryKeyData = inputData.main[inputIndex]![itemIndex]!.binary;
|
||||
if (binaryKeyData === undefined) {
|
||||
throw new NodeOperationError(node, 'No binary data exists on item!', {
|
||||
itemIndex,
|
||||
});
|
||||
throw new NodeOperationError(
|
||||
node,
|
||||
`This operation expects the node's input data to contain a binary file '${propertyName}', but none was found [item ${itemIndex}]`,
|
||||
{
|
||||
itemIndex,
|
||||
description: 'Make sure that the previous node outputs a binary file',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const binaryPropertyData = binaryKeyData[propertyName];
|
||||
if (binaryPropertyData === undefined) {
|
||||
throw new NodeOperationError(node, `Item has no binary property called "${propertyName}"`, {
|
||||
itemIndex,
|
||||
});
|
||||
throw new NodeOperationError(
|
||||
node,
|
||||
`The item has no binary field '${propertyName}' [item ${itemIndex}]`,
|
||||
{
|
||||
itemIndex,
|
||||
description:
|
||||
'Check that the parameter where you specified the input binary field name is correct, and that it matches a field in the binary input',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return binaryPropertyData;
|
||||
|
||||
Reference in New Issue
Block a user