jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.exceptionhandler
Interface ExceptionHandler

All Known Implementing Classes:
AlertExceptionHandler, JustWhingeExceptionHandler

public interface ExceptionHandler

An API which final fallback things which handle exceptions are expected to expose. Note that all classes which implement ExceptionHandler must be very, very defensively coded - an unhandled exception in an exception handler is a serious matter!


Method Summary
 void init(Context config)
          initialise me with this configuration
 void whinge(javax.servlet.ServletOutputStream out, java.lang.Exception e, Context context)
          do something at least moderately sensible with this exception, ideally in the process emitting some useful feedback to the user as an HTML block- level fragment (the header can be assumed to have been output already).
 

Method Detail

init

public void init(Context config)
          throws InitialisationException
initialise me with this configuration

Parameters:
config - the configuration
Throws:
InitialisationException - if something breaks horribly

whinge

public void whinge(javax.servlet.ServletOutputStream out,
                   java.lang.Exception e,
                   Context context)
            throws javax.servlet.ServletException
do something at least moderately sensible with this exception, ideally in the process emitting some useful feedback to the user as an HTML block- level fragment (the header can be assumed to have been output already).

Parameters:
out - an output stream on which things can be printed to the user
e - the exception being handled
context - the context in which it's being handled
Throws:
javax.servlet.ServletException - if something even worse happens (try not to do this!)

jacquard 1.12.0 by The Web Engineering Factory and Toolworks