fix: Do not show [object Object] in error message when validating type (no-changelog) (#9591)

This commit is contained in:
Michael Kret
2024-06-03 12:09:48 +03:00
committed by GitHub
parent 19e5c0397a
commit cda1e3f6e5
3 changed files with 29 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ import {
ApplicationError,
NodeOperationError,
deepCopy,
getValueDescription,
jsonParse,
validateFieldType,
} from 'n8n-workflow';
@@ -184,7 +185,7 @@ export const validateEntry = (
} else {
throw new NodeOperationError(
node,
`'${name}' expects a ${type} but we got '${String(value)}' [item ${itemIndex}]`,
`'${name}' expects a ${type} but we got ${getValueDescription(value)} [item ${itemIndex}]`,
{ description },
);
}