I am calling restTemplate.getForObject
to retrieve a certain value from Mongo DB. How to deal the exception if the expected data is not found in the DB?
Object[] mongodata = restTemplate.getForObject(resulturl,Object[].class,keyval);
list = Arrays.asList(mongodata);
where keyval is a string that contains a json and resulturl is the url for calling mongo