问题出现:使用aop中around进行日志输出时,ControllerAdvice进行异常捕获时只能捕获exception异常
原因:controller执行完成之后,使用aop获取切点数据时try catch抛出了Throwable异常导致controller进行捕获时只能捕获到exception异常
根本原因为执行顺序
当接收数据时为:Filter过滤器 > Interceptor拦截器 > ControllerAdvice > AOP。
当返回数据时为:AOP > ControllerAdvice > Interceptor拦截器 > Filter过滤器