tsondb 0.19.13 → 0.19.14

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.
@@ -21,13 +21,20 @@ export class DatabaseInMemory {
21
21
  const instanceFileNames = await readdir(entityDir);
22
22
  const instances = await mapAsync(instanceFileNames, async (instanceFileName) => {
23
23
  const id = basename(instanceFileName, extname(instanceFileName));
24
- return [
25
- id,
26
- {
24
+ try {
25
+ return [
27
26
  id,
28
- content: JSON.parse(await readFile(join(entityDir, instanceFileName), "utf-8")),
29
- },
30
- ];
27
+ {
28
+ id,
29
+ content: JSON.parse(await readFile(join(entityDir, instanceFileName), "utf-8")),
30
+ },
31
+ ];
32
+ }
33
+ catch (error) {
34
+ throw new Error(`Failed to load instance "${id}" of entity "${entity.name}"`, {
35
+ cause: error,
36
+ });
37
+ }
31
38
  }, ulimit);
32
39
  const instancesById = Dictionary.fromEntries(instances);
33
40
  return [entity.name, instancesById];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsondb",
3
- "version": "0.19.13",
3
+ "version": "0.19.14",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Lukas Obermann",