|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.engine.impl.DefaultErrorHandler
public class DefaultErrorHandler
The DefaultErrorHandler
is used by the
SlingRequestProcessorImpl
as long as no ErrorHandler
service
is registered.
Constructor Summary | |
---|---|
DefaultErrorHandler()
|
Method Summary | |
---|---|
void |
handleError(int status,
String message,
SlingHttpServletRequest request,
SlingHttpServletResponse response)
Backend implementation of the HttpServletResponse.sendError methods. |
void |
handleError(Throwable throwable,
SlingHttpServletRequest request,
SlingHttpServletResponse response)
Backend implementation of handling uncaught throwables. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultErrorHandler()
Method Detail |
---|
public void handleError(int status, String message, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException
This implementation resets the response before sending back a standardized response which just conveys the status, the message (either provided or a message derived from the status code), and server information.
This method logs error and does not write back and response data if the response has already been committed.
handleError
in interface ErrorHandler
status
- The HTTP status code to setmessage
- An optional message to write to the response. This message
may be null
.request
- The request object providing more information on the
request.response
- The response object used to send the status and message.
IOException
- May be thrown if an error occurrs sending the
response.public void handleError(Throwable throwable, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException
This implementation resets the response before sending back a standardized response which just conveys the status as 500/INTERNAL SERVER ERROR, the message from the throwable, the stacktrace, and server information.
This method logs error and does not write back and response data if the response has already been committed.
handleError
in interface ErrorHandler
throwable
- The Throwable
causing this method to be
called.request
- The request object providing more information on the
request.response
- The response object used to send the status and message.
IOException
- May be thrown if an error occurrs sending the
response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |