// the response output stream if reset does not reset this
response = new ErrorResponseWrapper(response);
Filter[] filters = filterManager.getFilters(FilterChainType.ERROR);
if (filters != null && filters.length > 0) {
FilterChain processor = new AbstractSlingFilterChain(filters) {
@Override
protected void render(SlingHttpServletRequest request,
SlingHttpServletResponse response) throws IOException {
errorHandler.handleError(status, message, request, response);
}
};
request.getRequestProgressTracker().log(
"Applying " + FilterChainType.ERROR + " filters");
try {
processor.doFilter(request, response);
} catch (ServletException se) {
throw new SlingServletException(se);
}
} else {
errorHandler.handleError(status, message, request, response);