Replies: 1 comment 9 replies
-
Try refactoring your code so that the state you want to update is passed by reference in a If that doesn't work, then we'd need to see a concrete example of what you're trying to do with code we can run. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thanks in advance for your help
Question
Requirements for context:
1 and 2 are easy enough with a try-catch within
ResiliencePipeline.ExecuteAsync
that updates the variable and re-throws, but 3 is not satisfied because the logic within thecatch
won't get tested when chaos simulates an exception.What is the recommended way to set this up such that the local exception handling logic is also tested by the chaos faults?
Ideal
What I was hoping for was an argument to
ResiliencePipeline.ExecuteAsync
that would let me execute a callback when my code or the chaos sim throws an exception (or maybe more generally when it returns an Outcome), before the pipeline starts handling it.Options considered
ExecuteAsync
call within the try-catch: doesn't work because the local variable needs to be updated before the retry is executedResiliencePipelineBuilder
to add another strategy (like a Fallback which handles the local variable update) to the existing pipeline: doesn't work because the chaos step would only be included in the existing pipeline, and wouldn't be applied to the new strategyBeta Was this translation helpful? Give feedback.
All reactions