File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ var pipeline = new ResiliencePipelineBuilder<HttpResponseMessage>()
5858 ShouldHandle = static args => args .Outcome switch
5959 {
6060 { Result .StatusCode : HttpStatusCode .InternalServerError } => PredicateResult .True (),
61- _ => PredicateResult .False ()
61+ _ => PredicateResult .False (),
6262 },
6363 BackoffType = DelayBackoffType .Exponential ,
6464 UseJitter = true ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ private static ValueTask<bool> HandleTransientHttpError(Outcome<HttpResponseMess
1717 { Exception : HttpRequestException } => PredicateResult .True (),
1818 { Result .StatusCode : HttpStatusCode .RequestTimeout } => PredicateResult .True (),
1919 { Result .StatusCode : >= HttpStatusCode .InternalServerError } => PredicateResult .True (),
20- _ => PredicateResult .False ()
20+ _ => PredicateResult .False (),
2121};
2222
2323private static RetryStrategyOptions <HttpResponseMessage > GetRetryOptions () =>
Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ new ResiliencePipelineBuilder()
9292 ShouldHandle = args => args .Outcome switch
9393 {
9494 { Exception : InvalidOperationException } => PredicateResult .True (),
95- { Result : string result } when result == " Failure" => PredicateResult .True (),
96- { Result : int result } when result == - 1 => PredicateResult .True (),
97- _ => PredicateResult .False ()
95+ { Result : string result } when result is " Failure" => PredicateResult .True (),
96+ { Result : int result } when result is - 1 => PredicateResult .True (),
97+ _ => PredicateResult .False (),
9898 },
9999 })
100100 .Build ();
@@ -107,7 +107,7 @@ new ResiliencePipelineBuilder<string>()
107107 {
108108 { Exception : InvalidOperationException } => PredicateResult .True (),
109109 { Result : { } result } when result == " Failure" => PredicateResult .True (),
110- _ => PredicateResult .False ()
110+ _ => PredicateResult .False (),
111111 },
112112 })
113113 .Build ();
Original file line number Diff line number Diff line change @@ -405,8 +405,8 @@ new ResiliencePipelineBuilder<HttpResponseMessage>().AddRetry(new RetryStrategyO
405405 ShouldHandle = static args => args .Outcome switch
406406 {
407407 { Exception : SomeExceptionType } => PredicateResult .True (),
408- { Result : { StatusCode : HttpStatusCode .InternalServerError } } => PredicateResult .True (),
409- _ => PredicateResult .False ()
408+ { Result . StatusCode : HttpStatusCode .InternalServerError } => PredicateResult .True (),
409+ _ => PredicateResult .False (),
410410 },
411411 MaxRetryAttempts = 3 ,
412412})
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ var options = new RetryStrategyOptions<HttpResponseMessage>
8282 { Exception : HttpRequestException } => PredicateResult .True (),
8383 { Exception : TimeoutRejectedException } => PredicateResult .True (), // You can handle multiple exceptions
8484 { Result : HttpResponseMessage response } when ! response .IsSuccessStatusCode => PredicateResult .True (),
85- _ => PredicateResult .False ()
85+ _ => PredicateResult .False (),
8686 }
8787};
8888```
You can’t perform that action at this time.
0 commit comments