mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
Revert "returns warning instead of error when field not found"
This reverts commit 3fca52bc81580d460d4de0b468ea7a4f8805a4d5.
This commit is contained in:
parent
60edb9a41a
commit
1f4639f834
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue