diff --git a/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml b/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml index b53220d0dbf8..c1e5c4ed574b 100644 --- a/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml +++ b/bin/configs/csharp-restsharp-net4.7-multipleFrameworks.yaml @@ -8,3 +8,4 @@ additionalProperties: targetFramework: netstandard2.1;net47 useCompareNetObjects: "true" equatable: true + throwOnAnyError: true diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs index 879b06b7645b..029798be3ae0 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/ApiClient.cs @@ -468,7 +468,8 @@ private async Task> ExecClientAsync(Func> DeserializeRestResponseFromPolicyAsync(Re } else { - return new RestResponse(request) - { - ErrorException = policyResult.FinalException - }; + throw policyResult.FinalException ?? new InvalidOperationException("The retry policy failed without an exception."); } }