eureka
tanghc 4 years ago
parent 9ca2488f73
commit 1ef78cf582
  1. 5
      sop-gateway/src/main/java/com/gitee/sop/gateway/interceptor/MyRouteInterceptor.java

@ -5,6 +5,7 @@ import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptorContext;
import com.gitee.sop.gatewaycommon.param.ApiParam; import com.gitee.sop.gatewaycommon.param.ApiParam;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
import java.net.URI; import java.net.URI;
@ -34,6 +35,10 @@ public class MyRouteInterceptor implements RouteInterceptor {
@Override @Override
public void afterRoute(RouteInterceptorContext context) { public void afterRoute(RouteInterceptorContext context) {
String serviceErrorMsg = context.getServiceErrorMsg();
if (StringUtils.hasText(serviceErrorMsg)) {
log.error("错误信息:{}", serviceErrorMsg);
}
} }
@Override @Override

Loading…
Cancel
Save