01: /*
02: * Created on 5 Jul 2006
03: */
04: package uk.org.ponder.rsf.processor;
05:
06: import uk.org.ponder.streamutil.write.PrintOutputStream;
07:
08: /** A bean handling "double-fault" rendering errors implements this
09: * interface. A double-fault is declared when an unexpected exception is
10: * thrown rendering the default view for an application, when this view
11: * is already being rendered as a result of a redirect from a level-1 error.
12: * This redirect condition is by default signalled by setting the
13: * <code>errorredirect</code> request attribute.
14: * @author Antranig Basman (antranig@caret.cam.ac.uk)
15: *
16: */
17:
18: public interface FatalErrorHandler {
19: /** A return code from FatalErrorHandler indicating that this exception
20: * should be propagated to a handler outside the RSF system.
21: */
22: public static final String HANDLE_EXCEPTION_UPSTAIRS = "Handle Exception Upstairs";
23:
24: /** A return code from FatalErrorHandler indicating that this exception
25: * has been correctly handled.
26: */
27: public static final String HANDLED = "Handled";
28:
29: /** Attempt to handle the supplied fatal error, by, if possible, rendering
30: * a suitable error message. If the implementation returns <code>false</code>
31: * or throws any kind of exception, the hard-wired RSF default message will
32: * be printed instead.
33: * @param t The exception causing the double fault.
34: * @param pos A PrintOutputStream where an error message may be rendered.
35: * @return One of the above Strings if the error has been successfully handled,
36: * or <code>null</code> if it has not.
37: */
38: public String handleFatalError(Throwable t, PrintOutputStream pos);
39: }
|