class ResourceCorruptedExceptionMapper implements ExceptionMapper<ResourceCorruptedException> {

    @Override
    public Response toResponse(ResourceCorruptedException exception) {
        return Response.status(Response.Status.BAD_REQUEST).
                entity(exception.getErrorDescriptor()).
                build();
    }

}