|
@@ -17,7 +17,6 @@
|
|
|
|
|
|
package org.springframework.cloud.openfeign;
|
|
|
|
|
|
-import cn.hutool.core.util.CharsetUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.pig4cloud.pigx.common.core.constant.CommonConstants;
|
|
|
import com.pig4cloud.pigx.common.core.util.R;
|
|
@@ -29,6 +28,7 @@ import org.springframework.cglib.proxy.MethodProxy;
|
|
|
import org.springframework.lang.Nullable;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
@@ -47,7 +47,7 @@ public class PigxFeignFallback<T> implements MethodInterceptor {
|
|
|
@Override
|
|
|
public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
|
|
|
String errorMessage = cause.getMessage();
|
|
|
- log.error("MicaFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, errorMessage);
|
|
|
+ log.error("PigxFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, errorMessage);
|
|
|
Class<?> returnType = method.getReturnType();
|
|
|
if (R.class != returnType) {
|
|
|
return null;
|
|
@@ -56,7 +56,7 @@ public class PigxFeignFallback<T> implements MethodInterceptor {
|
|
|
|
|
|
byte[] content = exception.content();
|
|
|
|
|
|
- String str = StrUtil.str(content, CharsetUtil.UTF_8);
|
|
|
+ String str = StrUtil.str(content, StandardCharsets.UTF_8);
|
|
|
|
|
|
return R.builder().code(CommonConstants.FAIL)
|
|
|
.msg(str).build();
|