Springboot 默认自带的异常返回不生效,无任何返回
2022-08-18 16:41:30.728 WARN 12708 --- [nio-8081-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing: public com.wuhu.shop.common.response.WebResponse com.wuhu.shop.auth.controller.UserController.loginWithPhoneAndPwd(com.wuhu.shop.auth.request.UserLoginDTO)]
这个接口请求没有带上请求体,异常信息都自动出来了,但是接口没有任何返回 如上图所示.
想要的效果是
{"timestamp":"2021-05-06T13:27:10.089+00:00",
"status":500,
"error":"Internal Server Error",
"trace":"java.lang.ArithmeticException: / by zero",
"message":"/ by zero",
"path":"/login.html"}
这样的springboot的错误返回,按理说这应该是springboot自带的功能,但它现在并没有生效.