diff --git a/src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs b/src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs index 1b6d545b5b1..21c836ef0a8 100644 --- a/src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs +++ b/src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs @@ -7,9 +7,9 @@ namespace Elasticsearch.Net { - public class ResponseBuilder + public class ResponseBuilder where TReturn : class - + { private const int BufferSize = 81920; private static readonly VoidResponse Void = new VoidResponse(); @@ -86,7 +86,7 @@ private void SetBody(ElasticsearchResponse response, Stream stream) if (this._requestData.CustomConverter != null) response.Body = this._requestData.CustomConverter(response, stream) as TReturn; else response.Body = this._requestData.ConnectionSettings.Serializer.Deserialize(stream); } - if (response.AllowAllStatusCodes) + if (response.AllowAllStatusCodes) ReadServerError(response, new MemoryStream(bytes), bytes); } else if (response.HttpStatusCode != null) @@ -115,10 +115,10 @@ private async Task SetBodyAsync(ElasticsearchResponse response, Stream else response.Body = await this._requestData.ConnectionSettings.Serializer.DeserializeAsync(stream, this._cancellationToken).ConfigureAwait(false); } if (response.AllowAllStatusCodes) - await ReadServerErrorAsync(response, new MemoryStream(bytes), bytes); + await ReadServerErrorAsync(response, new MemoryStream(bytes), bytes).ConfigureAwait(false); } else if (response.HttpStatusCode != null) - await ReadServerErrorAsync(response, stream, bytes); + await ReadServerErrorAsync(response, stream, bytes).ConfigureAwait(false); } }