feat: Better error when calling expression function on input that is undefined or null (#10009)
This commit is contained in:
@@ -12,6 +12,7 @@ import type {
|
||||
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
||||
import set from 'lodash/set';
|
||||
import { capitalize } from '@utils/utilities';
|
||||
import { ENABLE_LESS_STRICT_TYPE_VALIDATION } from '../../../utils/constants';
|
||||
|
||||
const configuredOutputs = (parameters: INodeParameters) => {
|
||||
const mode = parameters.mode as string;
|
||||
@@ -348,9 +349,8 @@ export class SwitchV3 implements INodeType {
|
||||
},
|
||||
) as boolean;
|
||||
} catch (error) {
|
||||
if (!options.looseTypeValidation) {
|
||||
error.description =
|
||||
"Try changing the type of comparison. Alternatively you can enable 'Less Strict Type Validation' in the options.";
|
||||
if (!options.looseTypeValidation && !error.description) {
|
||||
error.description = ENABLE_LESS_STRICT_TYPE_VALIDATION;
|
||||
}
|
||||
set(error, 'context.itemIndex', itemIndex);
|
||||
set(error, 'node', this.getNode());
|
||||
|
||||
Reference in New Issue
Block a user