File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
src/ModEndpoints.RemoteServices Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ builder.Services.AddRemoteServicesWithNewClient(
366366 {
367367 client .BaseAddress = new Uri (baseAddress );
368368 client .Timeout = TimeSpan .FromSeconds (5 );
369- })? .AddTransientHttpErrorPolicy (
369+ }).AddTransientHttpErrorPolicy (
370370 policyBuilder => policyBuilder .CircuitBreakerAsync (5 , TimeSpan .FromSeconds (30 )));
371371```
372372
Original file line number Diff line number Diff line change 3030 {
3131 client . BaseAddress = new Uri ( baseAddress ) ;
3232 client . Timeout = TimeSpan . FromSeconds ( 5 ) ;
33- } ) ? . AddTransientHttpErrorPolicy (
33+ } ) . AddTransientHttpErrorPolicy (
3434 policyBuilder => policyBuilder . CircuitBreakerAsync ( 5 , TimeSpan . FromSeconds ( 30 ) ) ) ;
3535
3636using IHost host = builder . Build ( ) ;
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public static IServiceCollection AddRemoteServiceToExistingClient<TRequest>(
8989 return services ;
9090 }
9191
92- public static IHttpClientBuilder ? AddRemoteServicesWithNewClient (
92+ public static IHttpClientBuilder AddRemoteServicesWithNewClient (
9393 this IServiceCollection services ,
9494 Assembly fromAssembly ,
9595 string clientName ,
@@ -130,6 +130,10 @@ public static IServiceCollection AddRemoteServiceToExistingClient<TRequest>(
130130 clientName ) ;
131131 }
132132 }
133+ if ( clientBuilder is null )
134+ {
135+ throw new InvalidOperationException ( $ "Cannot create HttpClient with client name { clientName } .") ;
136+ }
133137 return clientBuilder ;
134138 }
135139
You can’t perform that action at this time.
0 commit comments