@@ -268,23 +268,27 @@ export class ConfigValidator {
268
268
const validationResult = [ ] ;
269
269
270
270
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 ) ;
274
275
275
- if ( nameValidation !== null ) validationResult . push ( nameValidation ) ;
276
+ if ( nameValidation !== null ) validationResult . push ( nameValidation ) ;
276
277
277
- // Validate toName attribute
278
- const toNameValidation = validateToNameTag ( child , model , flatTree ) ;
278
+ // Validate toName attribute
279
+ const toNameValidation = validateToNameTag ( child , model , flatTree ) ;
279
280
280
- if ( toNameValidation !== null ) validationResult . push ( toNameValidation ) ;
281
+ if ( toNameValidation !== null ) validationResult . push ( toNameValidation ) ;
281
282
282
- // Validate by parentUnexpected parent tag
283
- const parentValidation = validateParentTag ( child , model ) ;
283
+ // Validate by parentUnexpected parent tag
284
+ const parentValidation = validateParentTag ( child , model ) ;
284
285
285
- if ( parentValidation !== null ) validationResult . push ( parentValidation ) ;
286
+ if ( parentValidation !== null ) validationResult . push ( parentValidation ) ;
286
287
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
+ }
288
292
}
289
293
290
294
if ( validationResult . length ) {
0 commit comments