zhou-hao преди 5 години
родител
ревизия
c117121692

+ 7 - 1
jetlinks-components/elasticsearch-component/src/main/java/org/jetlinks/community/elastic/search/utils/ReactorActionListener.java

@@ -1,5 +1,6 @@
 package org.jetlinks.community.elastic.search.utils;
 
+import lombok.extern.slf4j.Slf4j;
 import org.elasticsearch.ElasticsearchStatusException;
 import org.elasticsearch.action.ActionListener;
 import org.hswebframework.web.exception.BusinessException;
@@ -8,7 +9,7 @@ import reactor.core.publisher.Mono;
 import java.util.function.Consumer;
 import java.util.function.Function;
 
-
+@Slf4j
 public class ReactorActionListener {
 
     public static <R, T> Mono<R> mono(Consumer<ActionListener<T>> listenerConsumer,
@@ -38,6 +39,11 @@ public class ReactorActionListener {
         }).flatMap(Function.identity())
             .onErrorResume(ElasticsearchStatusException.class, e -> {
                 if (e.status().getStatus() == 404) {
+                    if(e.getMessage().contains("index_not_found_exception")){
+                        log.debug("{}",e.getMessage());
+                    }else{
+                        log.warn("{}",e.getDetailedMessage(),e);
+                    }
                     return Mono.empty();
                 }
                 return Mono.error(new BusinessException(e.getMessage(), e));