}
return new BadRequestException(Response.status(Response.Status.BAD_REQUEST).entity(json(sr)).build());
} else if(rootCause instanceof NumberFormatException) {
final SearchResponse sr = new SearchResponse();
sr.query = query;
sr.genericError = new GenericError();
sr.genericError.exceptionName = rootCause.getClass().getCanonicalName();
sr.genericError.message = rootCause.getMessage();
return new BadRequestException(Response.status(Response.Status.BAD_REQUEST).entity(json(sr)).build());
} else {
LOG.info("Root cause of SearchParseException has unexpected, generic type!" + rootCause.getClass());
final SearchResponse sr = new SearchResponse();
sr.query = query;
sr.genericError = new GenericError();
sr.genericError.exceptionName = rootCause.getClass().getCanonicalName();
sr.genericError.message = rootCause.getMessage();
return new BadRequestException(Response.status(Response.Status.BAD_REQUEST).entity(json(sr)).build());
}
}