OiO.lk Blog java How to flip error with no-error with projectreactor in Java?
java

How to flip error with no-error with projectreactor in Java?


I have instance of Mono<MyClass1>

It can either have value or be an error. Now I need to convert it to Mono<MyClass2> where error and no-error flipped

mono
   .doMagic( $ -> {
      if( error ) {
         return Mono.just( new MyClass2 .. )
      }
      else if( no-error ) {
         return Mono.error(...)
      }

   }

Is this possible?



You need to sign in to view this answers

Exit mobile version