class AbstractHtmlErrorHandler extends AbstractPlainTextHttpErrorHandler {

    @Override
    public void serve(final HttpServletResponse response) throws IOException {
        response.setStatus(getStatus());
        response.setContentType("text/html");

        if (StringUtilities.isEmpty(errorDocumentPath)) {
            serveDocument(response);
        } else {
            File file = new File(errorDocumentPath);
            if (file.exists()) {
                serveFile(response, file);
            } else {
                throw new IOException(getStatus() + " occurred, specified error handler ("
                        + errorDocumentPath + ") was not found.");
            }
        }
    }

    public  AbstractHtmlErrorHandler(final String status,
                                    final String message,
                                    final String explanation,
                                    final String errorDocumentPath);

}