Skip to content

Commit f80fbf8

Browse files
russcamMpdreamz
authored andcommitted
catch PlatformNotSupportedException (#2759)
when setting MaxConnectionsPerServer Closes #2758
1 parent cbd16d2 commit f80fbf8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Elasticsearch.Net/Connection/HttpConnection-CoreFx.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public virtual async Task<ElasticsearchResponse<TReturn>> RequestAsync<TReturn>(
116116

117117
private static readonly string MissingConnectionLimitMethodError =
118118
$"Your target platform does not support {nameof(ConnectionConfiguration.ConnectionLimit)}"
119-
+ $" please set {nameof(ConnectionConfiguration.ConnectionLimit)} to -1 on your connection configuration."
119+
+ $" please set {nameof(ConnectionConfiguration.ConnectionLimit)} to -1 on your connection configuration/settings."
120120
+ $" this will cause the {nameof(HttpClientHandler.MaxConnectionsPerServer)} not to be set on {nameof(HttpClientHandler)}";
121121

122122
protected virtual HttpClientHandler CreateHttpClientHandler(RequestData requestData)
@@ -137,6 +137,10 @@ protected virtual HttpClientHandler CreateHttpClientHandler(RequestData requestD
137137
{
138138
throw new Exception(MissingConnectionLimitMethodError, e);
139139
}
140+
catch (PlatformNotSupportedException e)
141+
{
142+
throw new Exception(MissingConnectionLimitMethodError, e);
143+
}
140144
}
141145

142146
if (!requestData.ProxyAddress.IsNullOrEmpty())

0 commit comments

Comments
 (0)