File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
packages/shared/sdk-server/src Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,16 @@ export default class FileDataInitializerFDv2 implements subsystemCommon.DataSour
102102 } ,
103103 ) ;
104104
105- this . _fileLoader . loadAndWatch ( ) ;
105+ this . _fileLoader . loadAndWatch ( ) . catch ( ( err ) => {
106+ this . _logger ?. error ( 'Error loading files' , err ) ;
107+ statusCallback (
108+ subsystemCommon . DataSourceState . Closed ,
109+ new LDPollingError (
110+ DataSourceErrorKind . NetworkError ,
111+ `Failed to load files: ${ err instanceof Error ? err . message : String ( err ) } ` ,
112+ ) ,
113+ ) ;
114+ } ) ;
106115 }
107116
108117 private _processFileData ( results : { path : string ; data : string } [ ] ) {
Original file line number Diff line number Diff line change @@ -253,7 +253,12 @@ function validateDataSystemOptions(options: Options): {
253253 }
254254 // Preserve initializer options if it was provided, since it's not validated by validateTypesAndNames.
255255 // Currently, setting this option is most commonly used as an override of default initializer options.
256- if ( options . dataSource && 'initializerOptions' in options . dataSource ) {
256+ // Check that the value is not undefined to avoid overwriting defaults when explicitly set to undefined.
257+ if (
258+ options . dataSource &&
259+ 'initializerOptions' in options . dataSource &&
260+ options . dataSource . initializerOptions !== undefined
261+ ) {
257262 validatedDataSourceOptions . initializerOptions = options . dataSource . initializerOptions ;
258263 }
259264
You can’t perform that action at this time.
0 commit comments