@ConsumerType public interface ErrorHandler
ErrorHandler
defines the interface of the service used by
the Sling to handle calls to HttpServletResponse.sendError
and
to handle uncaught Throwable
s.Modifier and Type | Method and Description |
---|---|
void |
handleError(int status,
java.lang.String message,
SlingHttpServletRequest request,
SlingHttpServletResponse response)
Called to render a response for a HTTP status code.
|
void |
handleError(java.lang.Throwable throwable,
SlingHttpServletRequest request,
SlingHttpServletResponse response)
Called to render a response for an uncaught
Throwable . |
void handleError(int status, java.lang.String message, SlingHttpServletRequest request, SlingHttpServletResponse response) throws java.io.IOException
If the response has already been committed, an error message should be logged but no further processing should take place.
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.java.io.IOException
- May be thrown if an error occurrs sending the
response.void handleError(java.lang.Throwable throwable, SlingHttpServletRequest request, SlingHttpServletResponse response) throws java.io.IOException
Throwable
.
If the response has already been committed, an error message should be logged but no further processing should take place.
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.java.io.IOException
- May be thrown if an error occurrs sending the
response.Copyright © 2010 - 2020 Adobe. All Rights Reserved