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

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 14bf5c239 [ISSUE #4199] Catch Exception instead of Throwable (#4234)
14bf5c239 is described below

commit 14bf5c239b016bab788be42bf04af0691d4931fc
Author: codingprh <[email protected]>
AuthorDate: Thu Jul 20 15:52:05 2023 +0800

    [ISSUE #4199] Catch Exception instead of Throwable (#4234)
    
    * fix: Catch Exception instead of Throwable
    
    * style: code checkstyle.
    
    ---------
    
    Co-authored-by: noah.pan <[email protected]>
---
 .../runtime/core/protocol/grpc/service/EventEmitter.java    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/EventEmitter.java
 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/EventEmitter.java
index c1eec14a5..c4b21106b 100644
--- 
a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/EventEmitter.java
+++ 
b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/core/protocol/grpc/service/EventEmitter.java
@@ -19,7 +19,6 @@ package 
org.apache.eventmesh.runtime.core.protocol.grpc.service;
 
 import io.grpc.stub.StreamObserver;
 
-
 import lombok.extern.slf4j.Slf4j;
 
 @Slf4j
@@ -34,24 +33,24 @@ public class EventEmitter<T> {
     public synchronized void onNext(T event) {
         try {
             emitter.onNext(event);
-        } catch (Throwable t) {
-            log.warn("StreamObserver Error onNext. {}", t.getMessage());
+        } catch (Exception e) {
+            log.warn("StreamObserver Error onNext. {}", e.getMessage());
         }
     }
 
     public synchronized void onCompleted() {
         try {
             emitter.onCompleted();
-        } catch (Throwable t) {
-            log.warn("StreamObserver Error onCompleted. {}", t.getMessage());
+        } catch (Exception e) {
+            log.warn("StreamObserver Error onCompleted. {}", e.getMessage());
         }
     }
 
     public synchronized void onError(Throwable t) {
         try {
             emitter.onError(t);
-        } catch (Throwable t1) {
-            log.warn("StreamObserver Error onError. {}", t1.getMessage());
+        } catch (Exception e) {
+            log.warn("StreamObserver Error onError. {}", e.getMessage());
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to