|
@@ -3,6 +3,7 @@ package com.persagy.apm.common.config;
|
|
|
import com.persagy.apm.common.exception.RpcException;
|
|
|
import com.persagy.apm.common.response.*;
|
|
|
import com.persagy.common.enums.ResponseCode;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.aspectj.lang.annotation.AfterReturning;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Pointcut;
|
|
@@ -14,6 +15,7 @@ import org.aspectj.lang.annotation.Pointcut;
|
|
|
* @version V1.0 2021/3/24 4:55 下午
|
|
|
**/
|
|
|
@Aspect
|
|
|
+@Slf4j
|
|
|
public class PoemsFeignExceptionHandler {
|
|
|
|
|
|
@Pointcut("@within(org.springframework.cloud.openfeign.FeignClient)")
|
|
@@ -38,6 +40,7 @@ public class PoemsFeignExceptionHandler {
|
|
|
|
|
|
String success = "success";
|
|
|
if (!success.equals(result)) {
|
|
|
+ log.error("feign调用接口失败,返回结果为:{}", res);
|
|
|
throw new RpcException(reason);
|
|
|
}
|
|
|
}
|