Skip to content

Commit 091d66d

Browse files
Update the code-snippets in the documentation (#3019)
Signed-off-by: polly-updater-bot[bot] <138034000+polly-updater-bot[bot]@users.noreply.github.com> Co-authored-by: polly-updater-bot[bot] <138034000+polly-updater-bot[bot]@users.noreply.github.com>
1 parent ed3d603 commit 091d66d

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

docs/chaos/outcome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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,

docs/community/http-client-integrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

2323
private static RetryStrategyOptions<HttpResponseMessage> GetRetryOptions() =>

docs/extensibility/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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();

docs/migration-v8.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
})

docs/strategies/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
```

0 commit comments

Comments
 (0)