Revert "returns warning instead of error when field not found"

This reverts commit 3fca52bc81580d460d4de0b468ea7a4f8805a4d5.
This commit is contained in:
Ria 2025-01-14 11:19:50 +01:00
parent 60edb9a41a
commit 1f4639f834

View file

@ -7,8 +7,6 @@ import {
type INodeTypeDescription,
NodeExecutionOutput,
type NodeExecutionHint,
NodeExecutionOutput,
type NodeExecutionHint,
} from 'n8n-workflow';
import {
@ -245,7 +243,6 @@ export class Summarize implements INodeType {
placeholder: 'Add option',
default: {},
options: [
// [ria] potentially delete this option??
{
displayName: 'Continue if Field Not Found',
name: 'continueIfFieldNotFound',
@ -323,18 +320,13 @@ export class Summarize implements INodeType {
const nodeVersion = this.getNode().typeVersion;
if (nodeVersion < 2.1) {
const fieldNotFound: string | undefined = checkIfFieldExists.call(
this,
newItems,
fieldsToSummarize,
getValue,
);
if (options.continueIfFieldNotFound || fieldNotFound) {
// const itemData: IPairedItemData[] = generatePairedItemData(items.length); // [ria] had to delete type because i was getting compilation errors
try {
checkIfFieldExists.call(this, newItems, fieldsToSummarize, getValue);
} catch (error) {
if (nodeVersion > 1 || options.continueIfFieldNotFound) {
const itemData = generatePairedItemData(items.length);
const fieldNotFoundHint: NodeExecutionHint = {
message: `The field '${fieldNotFound}' does not exist in any items.`,
message: error.message,
location: 'outputPane',
};
return new NodeExecutionOutput([[{ json: {}, pairedItem: itemData }]], [fieldNotFoundHint]);