Skip to content

Commit

Permalink
RedirectSingle: avoid extra operator for exception handling path (#…
Browse files Browse the repository at this point in the history
…3114)

Use new `Single.subscribe(...)` overload introduced in
[#3112](#3112) that takes
`errorConsumer` to avoid using extra operator `whenOnError`. It will
also help to avoid logging those exceptions by `SimpleSingleSubscriber`
(hard to relate to a real request) and instead they will only bubble up
on the caller path.
  • Loading branch information
idelpivnitskiy authored Nov 18, 2024
1 parent c14e4aa commit 38cc84b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ public void onSuccess(@Nullable final StreamingHttpResponse response) {
if (!terminalDelivered) {
// Drain response payload body before propagating the cause
sequentialCancellable.nextCancellable(response.messageBody().ignoreElements()
.whenOnError(suppressed -> safeOnError(target, addSuppressed(cause, suppressed)))
.subscribe(() -> safeOnError(target, cause)));
.subscribe(() -> safeOnError(target, cause),
suppressed -> safeOnError(target, addSuppressed(cause, suppressed))));
} else {
LOGGER.info("Ignoring exception from onSuccess of Subscriber {}.", target, cause);
}
Expand Down

0 comments on commit 38cc84b

Please sign in to comment.