Difference between using map or flatmap to handle errors #1952
-
|
Hello If we handle errors in Mutiny should we prefer one way over other way, or is there some logical difference? Thx for help |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The second option works better IMHO, because you can have fine control and report a failed |
Beta Was this translation helpful? Give feedback.
-
|
So I have followup question :) In pseudo-code like that, wrapping error in Uni is making us do map + call + map. Is it my overinterpretation, that this is more proper? Since we have here sync code and do now throw in call/flatMap, first option seems better in this case. I have tested that also is working without wrapping in Uni so we have same control on failed Uni or you had other issue in mind? |
Beta Was this translation helpful? Give feedback.
The second option works better IMHO, because you can have fine control and report a failed
Uniif needed.