How can I handle exceptions with Spring Data Rest and the PagingAndSortingRepository?

前端 未结 2 503
逝去的感伤
逝去的感伤 2021-02-07 20:36

Let\'s say I have a repository like:

public interface MyRepository extends PagingAndSortingRepository {

    @Query(\"....\")
    Page<         


        
2条回答
  •  没有蜡笔的小新
    2021-02-07 21:09

    You could use @ControllerAdvice and render the content your way. Here is tutorial if you need know how to work on ControllerAdvice, just remember to return HttpEntity

提交回复
热议问题