Spring WebMVC异常处理



我有一个全局异常处理程序,该处理程序扩展了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重新引入此行为。

最新更新