|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.devel.ErrorFormatter
public class ErrorFormatter
The class that performs exception handling. Receives errors in any makumba page and treats them meant to be friendly
developer, so he'll see helpful stuff during development and not stupid stacktraces (which are shown only in case of
unknown exceptions) also indented for intercepting lack of authorization and show login pages. Most of the code was
copied from the TagExceptionServlet.
FIXME the exception hierarchy needs to be reviewed.
Field Summary | |
---|---|
(package private) static Object[][] |
errors
|
static ArrayList<String> |
jspReservedWordList
|
static String[] |
jspReservedWords
|
(package private) static Class<?>[] |
knownJSPruntimeErrors
|
protected boolean |
printeHeaderFooter
|
protected ServletContext |
servletContext
|
Constructor Summary | |
---|---|
ErrorFormatter()
|
|
ErrorFormatter(HttpServletRequest req,
ServletContext servletContext,
PrintWriter wr,
boolean printHeaderFooter)
|
Method Summary | |
---|---|
(package private) String |
formatElementData(HttpServletRequest req)
Displays information about the element (tag or EL expression) in which the error occurs in a nice way |
String |
getErrorMessage(HttpServletRequest req)
Returns a string describing the error that occurred. |
String |
getTitle()
|
(package private) void |
knownError(String title,
Throwable t,
Throwable original,
HttpServletRequest req,
PrintWriter wr)
Displays a knows error in the case of an error originating from a tag |
void |
logError(Throwable t,
HttpServletRequest req)
Stores the error details to the database (ErrorLog.mdd) |
(package private) String |
shortTrace(String s)
Filters out a short part of the stacktrace |
(package private) String |
shortTrace(String s,
int lineNumbers)
Cuts down a stack trace to the given number of lines. |
(package private) String |
trace(Throwable t)
Prints the stacktrace |
(package private) boolean |
treatJspException(Throwable original,
Throwable t,
PrintWriter wr,
HttpServletRequest req,
ServletContext servletContext,
boolean printHeaderFooter,
String title)
|
(package private) boolean |
treatJspRuntimeException(Throwable original,
Throwable t,
PrintWriter wr,
HttpServletRequest req,
ServletContext servletContext,
boolean printHeaderFooter)
|
(package private) void |
unknownError(Throwable original,
Throwable t,
PrintWriter wr,
HttpServletRequest req)
Displays an unknown error |
(package private) String |
unknownErrorMessage(Throwable original,
Throwable t,
HttpServletRequest req)
Returns a string describing an unknown error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static Object[][] errors
static final Class<?>[] knownJSPruntimeErrors
protected ServletContext servletContext
protected boolean printeHeaderFooter
public static String[] jspReservedWords
public static ArrayList<String> jspReservedWordList
Constructor Detail |
---|
public ErrorFormatter()
public ErrorFormatter(HttpServletRequest req, ServletContext servletContext, PrintWriter wr, boolean printHeaderFooter) throws IOException, ServletException
IOException
ServletException
Method Detail |
---|
public String getTitle()
public void logError(Throwable t, HttpServletRequest req)
t
- the exceptionreq
- the http request corresponding to the accessvoid knownError(String title, Throwable t, Throwable original, HttpServletRequest req, PrintWriter wr)
title
- title describing the errort
- the exceptionoriginal
- the original error exception, not treatedreq
- the http request corresponding to the accesswr
- the PrintWriter on which the error is printedString formatElementData(HttpServletRequest req)
req
- the http request corresponding to the current access
String trace(Throwable t)
t
- the exception
String shortTrace(String s)
s
- the stacktrace to be filtered
void unknownError(Throwable original, Throwable t, PrintWriter wr, HttpServletRequest req) throws IOException, ServletException
original
- the original error exception, not treatedt
- the exceptionwr
- the PrintWriter on which the error is printedreq
- the http request corresponding to the access
IOException
ServletException
public String getErrorMessage(HttpServletRequest req)
req
-
String unknownErrorMessage(Throwable original, Throwable t, HttpServletRequest req)
original
- t
-
String shortTrace(String s, int lineNumbers)
s
- a stacktrace as string.lineNumbers
- the number of lines to be displayed.
boolean treatJspRuntimeException(Throwable original, Throwable t, PrintWriter wr, HttpServletRequest req, ServletContext servletContext, boolean printHeaderFooter)
boolean treatJspException(Throwable original, Throwable t, PrintWriter wr, HttpServletRequest req, ServletContext servletContext, boolean printHeaderFooter, String title)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |