Package com.groiss.gui
Class DefaultErrorFormatter
java.lang.Object
com.groiss.gui.DefaultErrorFormatter
- All Implemented Interfaces:
ErrorFormatter
This class is responsible for showing the error page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the system is not yet set up or the user has admin rights.protected void
fillInDetails
(Throwable e, HTMLPage page) Default implementation of showing an error page.Default implementation for returning a JSONObject representation of the error.Returns the thread name, timestamp and stack-trace of the exception.
-
Constructor Details
-
DefaultErrorFormatter
public DefaultErrorFormatter()
-
-
Method Details
-
format
Default implementation of showing an error page.- Specified by:
format
in interfaceErrorFormatter
- Returns:
- the page, for example an HTMLPage object.
-
fillInDetails
-
getDetails
Returns the thread name, timestamp and stack-trace of the exception. The result is the empty string if the exception is a top level exception without an inner exception or the user is not allowed to see the details (canShowDetails()
). -
canShowDetails
public boolean canShowDetails()Returns true if the system is not yet set up or the user has admin rights. -
formatJSON
Default implementation for returning a JSONObject representation of the error. The object contains the following properties:- errornumber (only for ApplicationExceptions),
- message: the message text,
- title: the string "error " plus errornumber,
- error: title + message
- showHTML: if the error message can contain html text (true if exception sets setAllowHTMLMessage(true) or global parameter ep.exception.allowhtmlmessage is true).
- Specified by:
formatJSON
in interfaceErrorFormatter
- Returns:
- a json object
-