It would be nice to be able to run code when chaos is injected (by any of the simmy injection policies).
Example use-case:
var chaosExceptionPolicy = MonkeyPolicy
.InjectExceptionAsync(with => with
.Fault(new TimeoutException())
.InjectionRate(0.2)
.Enabled()
.OnInject((context, exception, cancellation) => logger.LogInformation("Injecting Chaos"));
Alternative:
Using InjectBehavior rather than InjectException, and throwing the exception myself would also work without changes in Simmy.
It would be nice to be able to run code when chaos is injected (by any of the simmy injection policies).
Example use-case:
Alternative:
Using
InjectBehaviorrather thanInjectException, and throwing the exception myself would also work without changes in Simmy.