Skip to content

Commit

Permalink
chore: improve logging in safe response observer
Browse files Browse the repository at this point in the history
Change-Id: I6b36da4824fee7c534bab4c3667332de2b678b4f
  • Loading branch information
igorbernstein2 committed Nov 4, 2024
1 parent ecf4d3e commit 19ce72f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public final void onResponse(ResponseT response) {
@Override
public final void onError(Throwable throwable) {
if (!isClosed.compareAndSet(false, true)) {
logException("Received error after the stream is closed");
logException("Received error after the stream is closed", throwable);
return;
}

Expand Down Expand Up @@ -113,6 +113,10 @@ private void logException(String message) {
LOGGER.log(Level.WARNING, message, new IllegalStateException(message));
}

private void logException(String message, Throwable cause) {
LOGGER.log(Level.WARNING, message, new IllegalStateException(message, cause));
}

protected abstract void onStartImpl(StreamController streamController);

protected abstract void onResponseImpl(ResponseT response);
Expand Down

0 comments on commit 19ce72f

Please sign in to comment.