From: Keats K. <ke...@xa...> - 2006-03-28 22:26:09
|
Eric B. Ridge wrote: > On Mar 28, 2006, at 11:09 AM, Marc Palmer wrote: > >> Isn't this what gives us the "<!-- Variable XXXX is undefined -->" >> type output in the templates? That's much more helpful - and >> sometimes a quick fix for null checking in a hacked together >> prototype - than it spewing a property exception and failing to >> build the page... > > > Yes and no. The ExceptionHelper (or whatever it's called) generally > traps all the PropertyExceptions, looks at the innards for things > like UndefinedMacro, null objects, etc, and makes the determination > about what to do. So he's the guy that writes out the <!-- Variable > XXX is undefined --> stuff. This is what the DefaultEvaluationExceptionHandler does. Other EEH's do different thing -- like throw an exception that bounces you to the error template for the CrankyEEH. btw, I've refactored the CountDirective to use the EEH. Should commit soon as I get the unit tests ready. > > We'd probably need to tighten up some try/catch blocks to make sure > we're passing exceptions into the ExceptionHelper (or whatever it's > called!), but that still seems better than having code that can > accidently cause an infinite loop. This could be a bit tricky. Undefined evaluates to undefined. (Expansion, or write, on undefined throws an exception.) For now we should just take a look at any code that say "while instanceof Macro ...". Keats > > eric > |