@smythos/sre 1.5.73 → 1.5.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smythos/sre",
3
- "version": "1.5.73",
3
+ "version": "1.5.74",
4
4
  "description": "Smyth Runtime Environment",
5
5
  "author": "Alaa-eddine KADDOURI",
6
6
  "license": "MIT",
@@ -55,7 +55,7 @@ export class JSONModelsProvider extends ModelsProviderConnector {
55
55
  } else {
56
56
  const modelsFolder = this.findModelsFolder();
57
57
  if (modelsFolder) {
58
- this._settings.mode === 'merge'; //Force merge mode if using models from .smyth folder
58
+ this._settings.mode = 'merge'; //Force merge mode if using models from .smyth folder
59
59
  this.initDirWatcher(modelsFolder); //this.started will be set to true when the watcher is ready
60
60
  }
61
61
  }
@@ -212,11 +212,14 @@ export class JSONModelsProvider extends ModelsProviderConnector {
212
212
  if (stats.isFile()) {
213
213
  //load the file
214
214
  const fileContent = fsSync.readFileSync(dir, 'utf-8');
215
- const modelData = JSON.parse(fileContent);
216
-
217
- if (this._settings?.mode === 'merge') this.models = { ...this.models, ...modelData };
218
- else this.models = modelData;
215
+ try {
216
+ const modelData = JSON.parse(fileContent);
219
217
 
218
+ if (this._settings?.mode === 'merge') this.models = { ...this.models, ...modelData };
219
+ else this.models = modelData;
220
+ } catch (error) {
221
+ console.error(`Error parsing model data from file "${dir}":`, error);
222
+ }
220
223
  this.started = true;
221
224
  return;
222
225
  }