Reputation: 1945
Is there anyway to map Spring exceptions (eg. JpaObjectRetrievalFailureException) to REST status code without using a controller specific @ExceptionHandler
? I would like to configure that system wide.
Upvotes: 2
Views: 366
Reputation: 20270
You can implement a HandlerExceptionResolver to catch specific exception types. Another possible strategy is to use a generic or abstract DAO class which implements the @ExceptionHandler
handlers.
Upvotes: 1