1212using Elastic . Elasticsearch . Ephemeral . Tasks . InstallationTasks . XPack ;
1313using Elastic . Elasticsearch . Ephemeral . Tasks . ValidationTasks ;
1414using Elastic . Elasticsearch . Managed . FileSystem ;
15+ using Elastic . Elasticsearch . Managed . ConsoleWriters ;
1516
1617namespace Elastic . Elasticsearch . Ephemeral
1718{
@@ -73,9 +74,9 @@ public class EphemeralClusterComposer<TConfiguration> : EphemeralClusterComposer
7374
7475 private bool NodeStarted { get ; set ; }
7576
76- public void OnStop ( ) => Itterate ( NodeStoppedTasks , ( t , c , fs ) => t . Run ( c , NodeStarted ) , false ) ;
77+ public void OnStop ( ) => Iterate ( NodeStoppedTasks , ( t , c , fs ) => t . Run ( c , NodeStarted ) , false ) ;
7778
78- public void Install ( ) => Itterate ( InstallationTasks , ( t , c , fs ) => t . Run ( c ) ) ;
79+ public void Install ( ) => Iterate ( InstallationTasks , ( t , c , fs ) => t . Run ( c ) ) ;
7980
8081 public void OnBeforeStart ( )
8182 {
@@ -86,7 +87,7 @@ public void OnBeforeStart()
8687 if ( Cluster . ClusterConfiguration . PrintYamlFilesInConfigFolder )
8788 tasks . Add ( new PrintYamlContents ( ) ) ;
8889
89- Itterate ( tasks , ( t , c , fs ) => t . Run ( c ) ) ;
90+ Iterate ( tasks , ( t , c , fs ) => t . Run ( c ) ) ;
9091
9192 NodeStarted = true ;
9293 }
@@ -97,10 +98,10 @@ public void OnAfterStart()
9798 var tasks = new List < IClusterComposeTask > ( AfterStartedTasks ) ;
9899 if ( Cluster . ClusterConfiguration . AdditionalAfterStartedTasks != null )
99100 tasks . AddRange ( Cluster . ClusterConfiguration . AdditionalAfterStartedTasks ) ;
100- Itterate ( tasks , ( t , c , fs ) => t . Run ( c ) , false ) ;
101+ Iterate ( tasks , ( t , c , fs ) => t . Run ( c ) , false ) ;
101102 }
102103
103- private void Itterate < T > ( IEnumerable < T > collection ,
104+ private void Iterate < T > ( IEnumerable < T > collection ,
104105 Action < T , IEphemeralCluster < TConfiguration > , INodeFileSystem > act , bool callOnStop = true )
105106 {
106107 lock ( _lock )
@@ -111,9 +112,10 @@ private void Itterate<T>(IEnumerable<T> collection,
111112 {
112113 act ( task , cluster , cluster . FileSystem ) ;
113114 }
114- catch ( Exception )
115+ catch ( Exception ex )
115116 {
116117 if ( callOnStop ) OnStop ( ) ;
118+ cluster . Writer . WriteError ( $ "{ ex . Message } { Environment . NewLine } { ex . StackTrace } ") ;
117119 throw ;
118120 }
119121 }
0 commit comments