Skip to content

Commit 24bee72

Browse files
committed
chore: addressing PR feedback
1 parent 15d65d7 commit 24bee72

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/shared/sdk-server/src/data_sources/fileDataInitilizerFDv2.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff 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 }[]) {

packages/shared/sdk-server/src/options/Configuration.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)