Skip to content

Commit 58f08aa

Browse files
committed
Remove obsolete ElasticsearchClientProductRegistration overrides (#8891)
(cherry picked from commit 5b708a2)
1 parent 625267e commit 58f08aa

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

src/Elastic.Clients.Elasticsearch/Core/ElasticsearchClientProductRegistration.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using System.Diagnostics.CodeAnalysis;
7-
using Elastic.Transport;
86
using Elastic.Transport.Products.Elasticsearch;
97

108
namespace Elastic.Clients.Elasticsearch;
@@ -14,26 +12,4 @@ internal sealed class ElasticsearchClientProductRegistration : ElasticsearchProd
1412
public ElasticsearchClientProductRegistration(Type markerType) : base(markerType) { }
1513

1614
public static ElasticsearchClientProductRegistration DefaultForElasticsearchClientsElasticsearch { get; } = new(typeof(ElasticsearchClient));
17-
18-
/// <summary>
19-
/// Elastic.Clients.Elasticsearch handles 404 in its <see cref="ElasticsearchResponse.IsValidResponse" />, we do not want the low level client throwing
20-
/// exceptions
21-
/// when <see cref="IRequestConfiguration.ThrowExceptions" /> is enabled for 404's. The client is in charge of
22-
/// composing paths
23-
/// so a 404 never signals a wrong URL but a missing entity.
24-
/// </summary>
25-
public override bool HttpStatusCodeClassifier(HttpMethod method, int statusCode) =>
26-
statusCode is >= 200 and < 300 or 404;
27-
28-
/// <summary>
29-
/// Makes the low level transport aware of Elastic.Clients.Elasticsearch's <see cref="ElasticsearchResponse" />
30-
/// so that it can peek in to its exposed error when reporting failures.
31-
/// </summary>
32-
public override bool TryGetServerErrorReason<TResponse>(TResponse response, [NotNullWhen(returnValue: true)] out string? reason)
33-
{
34-
if (response is not ElasticsearchResponse r)
35-
return base.TryGetServerErrorReason(response, out reason);
36-
reason = r.ElasticsearchServerError?.Error?.ToString();
37-
return !string.IsNullOrEmpty(reason);
38-
}
3915
}

src/Elastic.Clients.Elasticsearch/Elastic.Clients.Elasticsearch.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<ItemGroup>
3434
<PackageReference Include="Elastic.Esql" Version="0.11.0" />
35-
<PackageReference Include="Elastic.Transport" Version="0.16.0" />
35+
<PackageReference Include="Elastic.Transport" Version="0.17.0" />
3636
<PackageReference Include="PolySharp" Version="1.15.0">
3737
<PrivateAssets>all</PrivateAssets>
3838
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)