@aeriajs/core 0.0.285 → 0.0.287

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.
@@ -440,7 +440,14 @@ export const traverseDocument = async (what, description, _options) => {
440
440
  }
441
441
  return Result.error(error);
442
442
  }
443
- value = ctx.target[ctx.propName] = result;
443
+ try {
444
+ value = ctx.target[ctx.propName] = result;
445
+ }
446
+ catch (err) {
447
+ console.error('The document is invalid. It likely happened because the type of an existing property of the schema was changed (from object to string, for example). It is not a problem with the code, update or delete the document to get rid of this error.');
448
+ console.error(ctx.root);
449
+ throw err;
450
+ }
444
451
  }
445
452
  return Result.result(value);
446
453
  };
package/dist/database.js CHANGED
@@ -36,7 +36,7 @@ export const getDatabase = async () => {
36
36
  };
37
37
  export const getDatabaseSync = () => {
38
38
  if (!dbMemo.db) {
39
- throw new Error('getDatabaseSync() called with no active database');
39
+ throw new Error('getDatabaseSync() called with no active database -- make sure you call getDatabase() to instantiate the database first');
40
40
  }
41
41
  return dbMemo.db;
42
42
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aeriajs/core",
3
3
  "type": "module",
4
- "version": "0.0.285",
4
+ "version": "0.0.287",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "aeriaMain": "tests/fixtures/aeriaMain.js",
@@ -40,11 +40,11 @@
40
40
  "mongodb-memory-server": "^10.2.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@aeriajs/builtins": "^0.0.285",
43
+ "@aeriajs/builtins": "^0.0.287",
44
44
  "@aeriajs/common": "^0.0.161",
45
45
  "@aeriajs/entrypoint": "^0.0.169",
46
46
  "@aeriajs/http": "^0.0.200",
47
- "@aeriajs/security": "^0.0.285",
47
+ "@aeriajs/security": "^0.0.287",
48
48
  "@aeriajs/types": "^0.0.137",
49
49
  "@aeriajs/validation": "^0.0.185"
50
50
  },