|
|
|
@ -3,20 +3,21 @@ package cn.iocoder.yudao.framework.web.core.handler;
|
|
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil; |
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
|
import cn.hutool.extra.servlet.ServletUtil; |
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; |
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; |
|
|
|
|
import cn.iocoder.yudao.framework.common.exception.ServiceException; |
|
|
|
|
import cn.iocoder.yudao.framework.common.exception.YshopException; |
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.ApiResult; |
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; |
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.service.dto.ApiErrorLogCreateReqDTO; |
|
|
|
|
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; |
|
|
|
|
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; |
|
|
|
|
import io.github.resilience4j.ratelimiter.RequestNotPermitted; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.lang3.exception.ExceptionUtils; |
|
|
|
|
import org.apache.dubbo.rpc.RpcException; |
|
|
|
|
import org.springframework.security.access.AccessDeniedException; |
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
import org.springframework.validation.BindException; |
|
|
|
@ -94,6 +95,11 @@ public class GlobalExceptionHandler {
|
|
|
|
|
if (ex instanceof AccessDeniedException) { |
|
|
|
|
return accessDeniedExceptionHandler(request, (AccessDeniedException) ex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ex instanceof RpcException){ |
|
|
|
|
log.error("dubbo错误", ex); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
return defaultExceptionHandler(request, ex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|