List of usage examples for org.springframework.orm ObjectRetrievalFailureException getRootCause
@Nullable
public Throwable getRootCause()
From source file:net.jkratz.igdb.controller.advice.ErrorController.java
@RequestMapping(produces = "application/json") @ExceptionHandler(ObjectRetrievalFailureException.class) @ResponseStatus(value = HttpStatus.NOT_FOUND) public @ResponseBody Map<String, Object> handleObjectRetrievalFailureException( ObjectRetrievalFailureException ex) throws IOException { logger.error("Object not found", ex); Map<String, Object> map = Maps.newHashMap(); map.put("error", "Entity Not Found"); map.put("message", ex.getMessage()); if (ex.getRootCause() != null) { map.put("cause", ex.getRootCause().getMessage()); }//from ww w . j a v a 2 s .co m return map; }