@@ -52,11 +52,14 @@ public void runTask(String tenantId, ActionListener<IndexInsight> listener) {
5252 client ,
5353 tenantId ,
5454 ActionListener
55- .wrap (agentId -> { batchProcessFields (statisticalContentMap , agentId , tenantId , listener ); }, listener ::onFailure )
55+ .wrap (
56+ agentId -> { batchProcessFields (statisticalContentMap , agentId , tenantId , listener ); },
57+ e -> handleError ("Failed to get agent ID from ML config" , e , tenantId , listener )
58+ )
5659 );
57- }, e -> handleError ("Failed to get statistical content for index {}" , e , tenantId , listener )));
60+ }, e -> handleError ("Failed to get statistical content for index: {}" , e , tenantId , listener )));
5861 } catch (Exception e ) {
59- handleError ("Failed to execute field description task for index {}" , e , tenantId , listener );
62+ handleError ("Failed to execute field description task for index: {}" , e , tenantId , listener );
6063 }
6164 }
6265
@@ -170,7 +173,7 @@ private void batchProcessFields(
170173 saveResult ("" , tenantId , ActionListener .wrap (insight -> {
171174 log .info ("Empty field description completed for: {}" , sourceIndex );
172175 listener .onResponse (insight );
173- }, e -> handleError ("Failed to save empty field description result for index {}" , e , tenantId , listener )));
176+ }, e -> handleError ("Failed to save empty field description result for index: {}" , e , tenantId , listener )));
174177 return ;
175178 }
176179
@@ -195,13 +198,12 @@ private void batchProcessFields(
195198 saveResult (gson .toJson (resultsMap ), tenantId , ActionListener .wrap (insight -> {
196199 log .info ("Field description completed for: {}" , sourceIndex );
197200 listener .onResponse (insight );
198- }, e -> handleError ("Failed to save field description result for index {}" , e , tenantId , listener )));
201+ }, e -> handleError ("Failed to save field description result for index: {}" , e , tenantId , listener )));
199202 } else {
200- handleError ("Batch processing failed for index {}" , new Exception ("Batch processing failed" ), tenantId , listener );
203+ handleError ("Batch processing failed for index: {}" , new Exception ("Batch processing failed" ), tenantId , listener );
201204 }
202205 } catch (InterruptedException e ) {
203- log .error ("Batch processing interrupted for index: {}" , sourceIndex );
204- handleError ("Batch processing interrupted for index {}" , e , tenantId , listener );
206+ handleError ("Batch processing interrupted for index: {}" , e , tenantId , listener );
205207 }
206208 }
207209
0 commit comments