Comment From: rstoyanchev
I've updated this slightly differently to just createException
since in this example the left-hand side is Mono<Object>
but otherwise it could also be cast with the cast
operator. Note also that for 6.0 there is a new createErrror
method that casts to any type, similar to Mono#error, see #27637.
Comment From: filiphr
Thanks for doing the changes @rstoyanchev. I do understand the reasoning for your adaptation. However, I have to say that the example will still be confusing to people. Most of the time I do not have a Mono<Object>
as a return type. My main goal for this came from the fact that I wanted to not have exceptions thrown, but rather handle the error myself.
Nevertheless, hopefully people that are more familiar with the reactive stack will not be confused and will know that they need to do the flat map.
Great about the new createError
method.
Comment From: rstoyanchev
Fair enough. I've updated 5.3.x to show a more representative sample and in main it shows use of createError
already.
Comment From: filiphr
Thanks a lot @rstoyanchev, really appreciate that you are taking into consideration my feedback