} else { // exception instanceof SqlResourceException
status = Status.INTERNAL_SERVER_ERROR;
}
if (requestLogger == null) {
requestLogger = Factory.getRequestLogger();
final HttpRequestAttributes httpAttribs = getHttpRequestAttributes(httpRequest, requestBody,
requestMediaType, requestMediaType);
requestLogger.setHttpRequestAttributes(httpAttribs);
}
requestLogger.log(status.getStatusCode(), exception);
return Response.status(status).entity(exception.getMessage()).type(MediaType.TEXT_PLAIN).build();