@@ -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