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