Skip to content

Commit

Permalink
Handle exception loop by closeOnError
Browse files Browse the repository at this point in the history
  • Loading branch information
Pil0tXia committed Apr 2, 2024
1 parent 172804a commit a540e8a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void onNext(final CloudEvent message) {
@Override
public void onError(final Throwable t) {
log.error("Received Server side error", t);
close();
}

@Override
Expand Down Expand Up @@ -145,13 +146,15 @@ private void senderOnNext(final CloudEvent subscription) {
}
} catch (Exception e) {
log.error("StreamObserver Error onNext", e);
close();
}
}

private void senderOnComplete() {
try {
synchronized (sender) {
sender.onCompleted();
sender = null;
}
} catch (Exception e) {
log.error("StreamObserver Error onComplete", e);
Expand Down

0 comments on commit a540e8a

Please sign in to comment.