mandag 29. mars 2010

CometActor: What happens when render fails

I stumbled upon a strange bug the other day. My CometActor would just render the template content even if it seemed impossible looking at the render method. After some investigation I found out that the database layer swallowed an exception.



I also found out that when the render fails, it will display defaultXml which if you do some binding is not valid xml.

I later came to that overriding defaultXml must be a good way to make my CometActor more fault tolerant.



The problem in the code above is that we try to bind using the newly defined defaultXml and not the NodeSeq from the template. How can we get hold of template xml? Easy we just call super.defaultXml:

Ingen kommentarer:

Legg inn en kommentar