I currently have the following (I'm only interested in the end of the 
template.):

env.setTemplateProcessingTracer(new TemplateProcessingTracer() {
    int depth;
    public void enterElement(Environment env, TracedElement tracedElement) {
        depth++;
    }
    public void exitElement(Environment env) {
        depth--;
        if (depth == 0) {
            ... // Code goes here
        }
    }
});

Is there a way for exitElement to know that there has been an exception in the 
template and so it shouldn't do anything?
At the moment it seems to get called unconditionally.
Or is there a different way to hook into the processing?

P.S.
(I was surprised that exitElement doesn't also take a TracedElement parameter, 
but it isn't a problem.)

Cheers,
Simon

Reply via email to