Creating custom ErrorWebExceptionHandler fails

前端 未结 3 1641
无人共我
无人共我 2021-02-19 18:46

I am trying to create my own ErrorWebExceptionHandler in Spring Boot 2 by extending the default one but my application fails to start with the following message:

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-19 19:15

    You need to set the messageWriters on that instance, because they are required here. You should probably create that as a @Bean, just like Spring Boot is doing in the dedicated auto-configuration.

提交回复
热议问题