diff --git a/src/Elasticsearch.Net/Transport/Pipeline/RequestPipeline.cs b/src/Elasticsearch.Net/Transport/Pipeline/RequestPipeline.cs index 5087d506dde..8f712ead897 100644 --- a/src/Elasticsearch.Net/Transport/Pipeline/RequestPipeline.cs +++ b/src/Elasticsearch.Net/Transport/Pipeline/RequestPipeline.cs @@ -392,8 +392,7 @@ public ElasticsearchResponse CallElasticsearch(RequestData req (response as ElasticsearchResponse)?.Body?.Dispose(); audit.Event = AuditEvent.BadResponse; audit.Exception = e; - e.RethrowKeepingStackTrace(); - return null; //dead code due to call to RethrowKeepingStackTrace() + throw; } } } @@ -419,8 +418,7 @@ public async Task> CallElasticsearchAsync)?.Body?.Dispose(); audit.Event = AuditEvent.BadResponse; audit.Exception = e; - e.RethrowKeepingStackTrace(); - return null; //dead code due to call to RethrowKeepingStackTrace() + throw; } } } diff --git a/src/Elasticsearch.Net/Transport/Transport.cs b/src/Elasticsearch.Net/Transport/Transport.cs index 8eb429b7be6..32708036e06 100644 --- a/src/Elasticsearch.Net/Transport/Transport.cs +++ b/src/Elasticsearch.Net/Transport/Transport.cs @@ -83,10 +83,9 @@ public ElasticsearchResponse Request(HttpMethod method, string pipeline.MarkDead(node); seenExceptions.Add(pipelineException); } - catch (ResolveException resolveException) + catch (ResolveException) { - resolveException.RethrowKeepingStackTrace(); - return null; //dead code due to call to RethrowKeepingStackTrace() + throw; } catch (Exception killerException) { @@ -148,10 +147,9 @@ public async Task> RequestAsync(HttpMeth pipeline.MarkDead(node); seenExceptions.Add(pipelineException); } - catch (ResolveException resolveException) + catch (ResolveException) { - resolveException.RethrowKeepingStackTrace(); - return null; //dead code due to call to RethrowKeepingStackTrace() + throw; } catch (Exception killerException) { @@ -186,7 +184,7 @@ private static void Ping(IRequestPipeline pipeline, Node node) catch (PipelineException e) when (e.Recoverable) { pipeline.SniffOnConnectionFailure(); - e.RethrowKeepingStackTrace(); + throw; } } @@ -199,7 +197,7 @@ private static async Task PingAsync(IRequestPipeline pipeline, Node node) catch (PipelineException e) when (e.Recoverable) { await pipeline.SniffOnConnectionFailureAsync().ConfigureAwait(false); - e.RethrowKeepingStackTrace(); + throw; } } diff --git a/src/Tests/tests.yaml b/src/Tests/tests.yaml index 74cf2393ae3..0ea63a0af78 100644 --- a/src/Tests/tests.yaml +++ b/src/Tests/tests.yaml @@ -1,5 +1,5 @@ # mode either u (unit test), i (integration test) or m (mixed mode) -mode: m +mode: u # the elasticsearch version that should be started elasticsearch_version: 2.2.0 # whether we want to forcefully reseed on the node, if you are starting the tests with a node already running