Hi Jacek,
I am having the same issue.
One the server side I defined some errors, which a relevant for my project. These errors are put into an object named ErrorType. A simplified example looks like this:
Code:
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ModelAndView handleException(Exception ex, HttpServletRequest request) {
ModelAndView mov = new ModelAndView();
ErrorType errorType = ErrorTypeConverter.Convert(ex);
mov.addObject("errorType", errorType);
return mov;
}
On the client side I am reading the data like this:
Code:
try {
objectResponse = restTemplate.postForObject(location, objectType, ObjectType.class);
} catch (HttpClientErrorException e) {
//** Here I want to read out the error type instead **//
}
What I would need now, is an parser telling me which object to load. Did you come up with a solution yet? The most attractive way I found yet is here: http://stackoverflow.com/questions/3...-of-no-content