Skip to content

Commit

Permalink
Fix dead loop in onNext
Browse files Browse the repository at this point in the history
  • Loading branch information
oxsean committed Nov 19, 2024
1 parent a4a4312 commit 2676590
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ public final void onNext(Object data) {
doOnNext(data);
} catch (Throwable t) {
LOGGER.warn(INTERNAL_ERROR, "", "", "Error while doOnNext", t);
onError(t);
Throwable throwable = t;
try {
doOnError(throwable);
} catch (Throwable t1) {
LOGGER.warn(INTERNAL_ERROR, "", "", "Error while doOnError, original error: " + throwable, t1);
throwable = t1;
}
onCompleted(throwable);
}
}

Expand All @@ -105,7 +112,6 @@ public final void onError(Throwable throwable) {
if (closed) {
return;
}

try {
throwable = customizeError(throwable);
if (throwable == null) {
Expand All @@ -122,7 +128,6 @@ public final void onError(Throwable throwable) {
LOGGER.warn(INTERNAL_ERROR, "", "", "Error while doOnError, original error: " + throwable, t);
throwable = t;
}

onCompleted(throwable);
}

Expand Down

0 comments on commit 2676590

Please sign in to comment.