Chaos Outcome - Exception handling #2080
Replies: 3 comments 5 replies
-
My opinion is different here. I do not see this as an problem nor anti-pattern. Chaos outcome allows returning Why is that a problem?
|
Beta Was this translation helpful? Give feedback.
-
That's semi-true. You can setup an If you have multiple strategies then yet again the other strategies will see only the
You can't use the Outcome strategy to throw an exception. You have to use the Fault chaos for that. Currently the Outcome strategy either returns a specified value or |
Beta Was this translation helpful? Give feedback.
-
I'm surprised that no one has reported that issue yet as it is stated in the docs and examples (since the initial release) that the Outcome strategy is also able to inject exceptions as results (it turns out it's not working 🙃), which tells me that it seems users are not really using the Outcome strategy to inject exceptions, which is a good sign either way I'd say. With that said, I lean toward the third option: Make a clear separation between the Outcome and Fault chaos strategies and, update the docs, and validate in the Outcome strategy that |
Beta Was this translation helpful? Give feedback.
-
Based on the discussion what we have started in the #2071 we have an agreement that the Outcome chaos strategy does not throw an exception rather returns the
Result
of theOutcome
.Dotnet fiddle: https://dotnetfiddle.net/82Chpg
cc: @vany0114 , @martincostello , @martintmk
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions