Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 85fb7c9

Browse files
authored
fix: DEV-1020: Validation error about unknown tag (#723)
1 parent ac4a98d commit 85fb7c9

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/core/DataValidator/ConfigValidator.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,23 +268,27 @@ export class ConfigValidator {
268268
const validationResult = [];
269269

270270
for (const child of flatTree) {
271-
const model = Registry.getModelByTag(child.type);
272-
// Validate name attribute
273-
const nameValidation = validateNameTag(child, model);
271+
try {
272+
const model = Registry.getModelByTag(child.type);
273+
// Validate name attribute
274+
const nameValidation = validateNameTag(child, model);
274275

275-
if (nameValidation !== null) validationResult.push(nameValidation);
276+
if (nameValidation !== null) validationResult.push(nameValidation);
276277

277-
// Validate toName attribute
278-
const toNameValidation = validateToNameTag(child, model, flatTree);
278+
// Validate toName attribute
279+
const toNameValidation = validateToNameTag(child, model, flatTree);
279280

280-
if (toNameValidation !== null) validationResult.push(toNameValidation);
281+
if (toNameValidation !== null) validationResult.push(toNameValidation);
281282

282-
// Validate by parentUnexpected parent tag
283-
const parentValidation = validateParentTag(child, model);
283+
// Validate by parentUnexpected parent tag
284+
const parentValidation = validateParentTag(child, model);
284285

285-
if (parentValidation !== null) validationResult.push(parentValidation);
286+
if (parentValidation !== null) validationResult.push(parentValidation);
286287

287-
validationResult.push(...validateAttributes(child, model, propertiesToSkip));
288+
validationResult.push(...validateAttributes(child, model, propertiesToSkip));
289+
} catch (e) {
290+
validationResult.push(errorBuilder.unknownTag(child.type, child.name, child.type));
291+
}
288292
}
289293

290294
if (validationResult.length) {

0 commit comments

Comments
 (0)