-
Notifications
You must be signed in to change notification settings - Fork 563
Description
Thibaud Lepretre opened DATAREST-421 and commented
AbstractRepositoryRestController defines a number of @ExceptionHandler however like clearly explain here http://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc:
@ExceptionHandlermethods on the Controller are always selected before those on any@ControllerAdviceinstance
So as user I can't override the Spring DATA REST behavior without reimplement an HandlerExceptionResolver in order to inverse order choice between @ControllerAdvice and @ExceptionHandler methods
By switching the @ExceptionHandler methods to an instance of @ControllerAdvice user can override behavior by adding another @ControllerAdvice with better @Order inside applicationContext.
But we should be keep in mind this issue https://jira.spring.io/browse/SPR-11570. I don't know if the previous mechanism can works without the shared @ControllerAdvice, but I will try it as soon as possible.
If accepted I can send a pull request. I have already forked a working repository with @ControllerAdvice
Affects: 2.2 GA (Evans)
Referenced from: pull request #155
1 votes, 3 watchers