class InternalServerErrorController implements ErrorController {

    @SuppressWarnings("squid:S3752")
    @RequestMapping(value = ERROR_ENDPOINT, produces = "application/json")
    @ResponseBody
    public ResponseEntity<ApiMessageView> error(HttpServletRequest request) {
        final Throwable exc = (Throwable) request.getAttribute(ErrorUtils.ATTR_ERROR_EXCEPTION);

        ResponseEntity<ApiMessageView> entity = checkForSpecificErrors(request, exc);
        if (entity != null) {
            return entity;
        }

        return createResponseForInternalError(request, exc);
    }

    @Autowired public  InternalServerErrorController(MessageService messageService);

}