Trond Engell
03/24/2020, 3:36 PMIO
. In this case I am trying to guarantee that method log()
is called if result is either failure or success. Only the following is being printed, though:
Failure
I would have expected Finalized
to be printed also. Why is this not happening? Am I using raiseError in a way that was not intended? Any help is appreciated :)aballano
03/24/2020, 3:46 PMTrond Engell
03/24/2020, 3:47 PM0.10.4
aballano
03/24/2020, 3:51 PMaballano
03/24/2020, 3:52 PMTrond Engell
03/24/2020, 3:56 PMaballano
03/24/2020, 4:01 PMSatyam Agarwal
03/24/2020, 4:54 PMaballano
03/24/2020, 5:03 PMaballano
03/24/2020, 5:03 PMaballano
03/24/2020, 5:04 PMonCancel
and onError
as wellSatyam Agarwal
03/24/2020, 5:40 PM.guarantee(log())
. A simple flatmap{ log() }
or followedBy(log())
will always get executed, right ? There is absolutely no way where this can fail in my head, so why to use gurantee
here ? The reason why I am asking is, there could be other reasoning to use gurantee where working with resource is not the scenario. Thus so curious 🙂aballano
03/24/2020, 6:00 PMaballano
03/24/2020, 6:03 PMhandleError
to recover and then you can do your opsaballano
03/24/2020, 6:04 PMSatyam Agarwal
03/24/2020, 6:08 PMIO
.raiseError<Unit>(RuntimeException("Blarg!"))
.handleError{_ -> log() }
so an alternative to this would be using guarantee instead of using handleError or handleErrorWith ?aballano
03/24/2020, 6:21 PMSatyam Agarwal
03/24/2020, 6:27 PMaballano
03/24/2020, 6:38 PM