Explorar o código

:loud_sound: 添加日志记录。

冷冷 %!s(int64=6) %!d(string=hai) anos
pai
achega
25144fe059

+ 1 - 2
pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java

@@ -46,8 +46,6 @@ public class PigxFeignFallback<T> implements MethodInterceptor {
 	@Nullable
 	@Override
 	public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
-		String errorMessage = cause.getMessage();
-		log.error("PigxFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, errorMessage);
 		Class<?> returnType = method.getReturnType();
 		if (R.class != returnType) {
 			return null;
@@ -58,6 +56,7 @@ public class PigxFeignFallback<T> implements MethodInterceptor {
 
 		String str = StrUtil.str(content, StandardCharsets.UTF_8);
 
+		log.error("PigxFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, str);
 		return R.builder().code(CommonConstants.FAIL)
 				.msg(str).build();
 	}