diff --git a/src/Elastic.Elasticsearch.Managed/ClusterBase.cs b/src/Elastic.Elasticsearch.Managed/ClusterBase.cs index 124b31d..502e5b8 100644 --- a/src/Elastic.Elasticsearch.Managed/ClusterBase.cs +++ b/src/Elastic.Elasticsearch.Managed/ClusterBase.cs @@ -140,11 +140,18 @@ public IDisposable Start(IConsoleLineHandler writer, TimeSpan waitForStarted) public void Dispose() { - Started = false; - foreach (var node in Nodes) - node?.Dispose(); + try + { + Started = false; + foreach (var node in Nodes) + node?.Dispose(); - OnDispose(); + OnDispose(); + } + catch(Exception ex) + { + Writer.WriteError($"{ex.Message}{Environment.NewLine}{ex.StackTrace}"); + } } protected virtual void ModifyNodeConfiguration(NodeConfiguration nodeConfiguration, int port)