handling wrapped exceptions in spring mvc

前端 未结 3 1248
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 11:47

I have Spring MVC and jackson. When I start an incorrect request, Jackson mapping fails and UnrecognizedPropertyException is thrown. I want to handle this excep

3条回答
  •  借酒劲吻你
    2020-12-06 12:29

    We are using org.apache.commons.lang.exception.ExceptionUtils ...

    private myMethod (Throwable t) {
    
        if (ExceptionUtils.getRootCause(t) instanceof MyException) ...
    }
    

提交回复
热议问题