This is an automated email from the ASF dual-hosted git repository.

yaohaishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git

commit b24a03799c99d8f3c729b30f37eff453d5837d18
Author: yhs0092 <[email protected]>
AuthorDate: Fri Feb 14 09:33:35 2020 +0800

    [SCB-1691] code improve
    
    - print subscriber's exceptions only if exceptionPropagation is enabled
    - remove unnecessary import
---
 .../apache/servicecomb/core/handler/impl/ProducerOperationHandler.java  | 1 -
 .../apache/servicecomb/foundation/common/event/SimpleSubscriber.java    | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
 
b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
index 7f5b549..75e7492 100644
--- 
a/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
+++ 
b/core/src/main/java/org/apache/servicecomb/core/handler/impl/ProducerOperationHandler.java
@@ -22,7 +22,6 @@ import java.util.concurrent.CompletableFuture;
 
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.servicecomb.core.Const;
 import org.apache.servicecomb.core.Handler;
 import org.apache.servicecomb.core.Invocation;
 import org.apache.servicecomb.core.exception.ExceptionUtils;
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
index 2ff6998..e209f44 100644
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/event/SimpleSubscriber.java
@@ -106,8 +106,8 @@ public class SimpleSubscriber {
     try {
       dispatcher.accept(event);
     } catch (Throwable e) {
-      LOGGER.error("event process should not throw error. ", e);
       if (enableExceptionPropagation) {
+        LOGGER.error("event process should not throw error. ", e);
         throw e;
       }
     }

Reply via email to