freemarker.ext.misc
Class HtmlFormattedExceptionListener

java.lang.Object
  extended by freemarker.ext.misc.HtmlFormattedExceptionListener
All Implemented Interfaces:
TemplateExceptionListener, java.util.EventListener

public final class HtmlFormattedExceptionListener
extends java.lang.Object
implements TemplateExceptionListener

Exception listener that improves reporting for compile errors. Modified error reporting so that errors detected at compile time are returned as an entire HTML page rather than a comment. The error text is displayed on the page (not inside of a comment).

Version:
$Id: HtmlFormattedExceptionListener.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull, based on code by Dan Milstein

Constructor Summary
HtmlFormattedExceptionListener()
          Creates a new instance of HtmlFormattedExceptionListener
 
Method Summary
 void exceptionThrown(TemplateExceptionEvent e)
          Handles events that are created whenever an exception is thrown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlFormattedExceptionListener

public HtmlFormattedExceptionListener()
Creates a new instance of HtmlFormattedExceptionListener

Method Detail

exceptionThrown

public void exceptionThrown(TemplateExceptionEvent e)
Handles events that are created whenever an exception is thrown. This handler turns the event into either an HTML comment, or a fully-formed HTML page, depending on whether its a compile-time or run-time error. The result is inserted into the current output stream of the Template.

Specified by:
exceptionThrown in interface TemplateExceptionListener