我有一个全局异常处理程序,该处理程序扩展了ExceptionHandlerExceptionResolver
,可处理从我的@RestController
抛出的异常。响应中返回的JSON有效载荷包括一个"异常"字段。例如
{
"timestamp": 01010101010101
"exception": <some exception class>
}
从spring-webmvc
4.3.22.RELEASE
升级到5.0.8.RELEASE
后,缺少exception
字段。知道这是春季变化,还是我的代码?
找到了它。server.error.include-exception
默认情况下是错误的。将其设置为TRUE重新引入此行为。