Skip to content
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);
Clone this wiki locally