我有一个全局异常处理程序,它扩展了ExceptionHandlerExceptionResolver
,处理从我的@RestController
抛出的异常。响应中返回的JSON有效负载包括“异常”字段。例如。
{
"timestamp": 01010101010101
"exception": <some exception class>
}
从spring-webmvc
4.3.22.RELEASE
升级到5.0.8.RELEASE
后,exception
场失踪。不知道这是Spring更改,还是这可能是我的代码?
找到了。 server.error.include-exception
默认是假的。将其设置为true会重新引入此行为。