The SubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>) would swallow exceptions that reside in the Mono<I> initialResult.
As this is not helpful to the end user, this pull request provides an implementation of SubscriptionQueryResult#handle(...) that expects a Consumer<Throwable> to be given.
This so-called errorConsumer is invoked when subscribing the initialResult() generates an exception, when subscribing to the updates() generates an exception, and when the initialResultConsumer or updateConsumer throw an exception.
As such, the errorConsumer is invoked each time the SubscriptionQueryResult#cancel would be triggered.
Lastly, this PR deprecates SubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>) in favor of SubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>, Consumer<Throwable>) to ensure users think consciously about dealing with exceptions.
By doing the above, this pull request resolves #3123.
The
SubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>)
would swallow exceptions that reside in theMono<I> initialResult
. As this is not helpful to the end user, this pull request provides an implementation ofSubscriptionQueryResult#handle(...)
that expects aConsumer<Throwable>
to be given.This so-called
errorConsumer
is invoked when subscribing theinitialResult()
generates an exception, when subscribing to theupdates()
generates an exception, and when theinitialResultConsumer
orupdateConsumer
throw an exception. As such, theerrorConsumer
is invoked each time theSubscriptionQueryResult#cancel
would be triggered.Lastly, this PR deprecates
SubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>)
in favor ofSubscriptionQueryResult#handle(Consumer<? super I>, Consumer<? super U>, Consumer<Throwable>)
to ensure users think consciously about dealing with exceptions.By doing the above, this pull request resolves #3123.