-
Notifications
You must be signed in to change notification settings - Fork 1
Home
kolan edited this page Nov 15, 2024
·
1 revision
Welcome to the PoliNorError wiki!
var result =
new RetryPolicy(2)
.IncludeError<SomeException>()
.WithErrorProcessorOf((Exception ex, ProcessingErrorInfo pi) =>
logger.LogError(ex,
"Policy processed exception on {Attempt} attempt:",
(pi as RetryProcessingErrorInfo).RetryCount + 1))
.AddPolicyResultHandler((PolicyResult pr) =>
logger.LogWarning(
"{Errors} exceptions were thrown.",
pr.Errors.Count()))
.Handle(ActionThatCanThrowSomeException);