@@ -13,6 +13,7 @@ import * as Registry from '../../registry';
1313import { loadFieldsFromYaml , Fields , Field } from '../../fields/field' ;
1414import { getPackageKeysByStatus } from '../../packages/get' ;
1515import { InstallationStatus , RegistryPackage , CallESAsCurrentUser } from '../../../../types' ;
16+ import { appContextService } from '../../../../services' ;
1617
1718interface FieldFormatMap {
1819 [ key : string ] : FieldFormatMapItem ;
@@ -366,10 +367,11 @@ const getFieldFormatParams = (field: Field): FieldFormatParams => {
366367 return params ;
367368} ;
368369
369- export const ensureDefaultIndices = async ( callCluster : CallESAsCurrentUser ) =>
370+ export const ensureDefaultIndices = async ( callCluster : CallESAsCurrentUser ) => {
370371 // create placeholder indices to supress errors in the kibana Dashboards app
371372 // that no matching indices exist https://github.com/elastic/kibana/issues/62343
372- Promise . all (
373+ const logger = appContextService . getLogger ( ) ;
374+ return Promise . all (
373375 Object . keys ( IndexPatternType ) . map ( async indexPattern => {
374376 const defaultIndexPatternName = indexPattern + INDEX_PATTERN_PLACEHOLDER_SUFFIX ;
375377 const indexExists = await callCluster ( 'indices.exists' , { index : defaultIndexPatternName } ) ;
@@ -386,9 +388,9 @@ export const ensureDefaultIndices = async (callCluster: CallESAsCurrentUser) =>
386388 } ,
387389 } ) ;
388390 } catch ( putErr ) {
389- // throw new Error(`${defaultIndexPatternName} could not be created`);
390- throw new Error ( putErr ) ;
391+ logger . error ( `${ defaultIndexPatternName } could not be created` ) ;
391392 }
392393 }
393394 } )
394395 ) ;
396+ } ;
0 commit comments