Add a better error message for unknown widgets

This commit is contained in:
Jeremy Ruston
2013-01-01 18:00:02 +00:00
parent d96e0073ac
commit 2124dd1ac1
5 changed files with 59 additions and 6 deletions
+4 -4
View File
@@ -32,10 +32,10 @@ var WidgetRenderer = function(renderTree,renderContext,parseTreeNode) {
if(WidgetClass) {
this.widget = new WidgetClass(this);
} else {
// Error if we couldn't find the widget
this.children = this.renderTree.createRenderers(this.renderContext,[
{type: "text", text: "Unknown widget type '" + this.parseTreeNode.tag + "'"}
]);
WidgetClass = this.widgetClasses.error;
if(WidgetClass) {
this.widget = new WidgetClass(this,"Unknown widget '" + this.parseTreeNode.tag + "'");
}
}
};