log.fatal(e,e);
}
}
if (!injector.getInstance(Settings.class).isDebug()) {
// TODO ability to specify 404 handler
SimpleHttpResponse response = new SimpleHttpResponse("Page not found");
response.setStatusCode(404);
try {
response.render(servletRequest, servletResponse);
} catch (HttpException e2) {
log.error(e2,e2);
throw new ServletException(e);
}
} else {
throw new ServletException(e);
}
} catch (FileUploadException e) {
log.error(e,e);
try {
request.close();
} catch (HttpException e1) {
log.error(e1,e1);
}
// TODO Pretty print the exception and stack trace, request information, etc
if (!injector.getInstance(Settings.class).isDebug()) {
HttpResponse response = new SimpleHttpResponse("Unrecoverable error processing uploaded files, please contact support");
try {
response.render(servletRequest, servletResponse);
} catch (HttpException e2) {
log.error(e2,e2);
throw new ServletException(e);
}
}
} catch (HttpException e) {
log.error(String.format("HttpException while processing for user '%s' %s:%s", request.getUser(), context, path));
log.error(e,e);
try {
request.close();
} catch (HttpException e1) {
log.error(e1,e1);
}
// TODO Pretty print the exception and stack trace, request information, etc
// TODO can this exception be handled by middleware? middleware is not really avaliable here as it is handled in the requestProcessor...
if (!injector.getInstance(Settings.class).isDebug()) {
HttpResponse response = new SimpleHttpResponse("Unrecoverable error, please contact support");
try {
response.render(servletRequest, servletResponse);
} catch (HttpException e2) {
log.error(e2,e2);
throw new ServletException(e);
}
} else {