Hasznos, ha hibás xtype esetén nem egyszerű index hibát kapunk, hanem a hibát megmagyarázó üzenetet:
if (config.render) {
return config;
}
var xtype = config.xtype || defaultType;
if (!Ext.ComponentMgr.types[xtype]) {
throw 'Unknown xtype: ' + xtype;
}
return new Ext.ComponentMgr.types[xtype](config);
};
Szerencsére ExtJS4 esetén ezzel már nincsen gond, az ext-all-dev.js számtalan hasonló ellenőrzést tartalmaz.