|
|
@@ -2,6 +2,7 @@ package com.mrxu.framework.boot.handle;
|
|
|
|
|
|
|
|
|
import com.mrxu.framework.boot.feign.FeignProviderException;
|
|
|
+import com.mrxu.framework.boot.web.ServletUtils;
|
|
|
import com.mrxu.framework.common.util.BaseCode;
|
|
|
import com.mrxu.framework.common.util.BusinessException;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -16,6 +17,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
/**
|
|
|
* @Author: xujunwei
|
|
|
* @Description: 此异常拦截给微服务提供方使用,不能与WebExceptionHandler 同时使用
|
|
|
@@ -64,7 +67,8 @@ public class FeignProviderExceptionHandler {
|
|
|
}
|
|
|
|
|
|
public Object rendError(boolean isBusinessException,BaseCode code,Throwable cause) {
|
|
|
- FeignProviderException exception = new FeignProviderException(isBusinessException,serviceName,code,cause);
|
|
|
+ HttpServletRequest request = ServletUtils.getRequest();
|
|
|
+ FeignProviderException exception = new FeignProviderException(isBusinessException,serviceName,request.getRequestURI(),code,cause);
|
|
|
return exception;
|
|
|
}
|
|
|
|