@apibara/plugin-mongo 2.1.0-beta.13 → 2.1.0-beta.15

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/dist/index.cjs CHANGED
@@ -44,7 +44,9 @@ async function cleanupStorage(db, session, collections) {
44
44
  try {
45
45
  await db.collection(collection).deleteMany({}, { session });
46
46
  } catch (error) {
47
- throw new Error(`Failed to clean up collection ${collection}: ${error}`);
47
+ throw new Error(`Failed to clean up collection ${collection}`, {
48
+ cause: error
49
+ });
48
50
  }
49
51
  }
50
52
  }
package/dist/index.mjs CHANGED
@@ -42,7 +42,9 @@ async function cleanupStorage(db, session, collections) {
42
42
  try {
43
43
  await db.collection(collection).deleteMany({}, { session });
44
44
  } catch (error) {
45
- throw new Error(`Failed to clean up collection ${collection}: ${error}`);
45
+ throw new Error(`Failed to clean up collection ${collection}`, {
46
+ cause: error
47
+ });
46
48
  }
47
49
  }
48
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apibara/plugin-mongo",
3
- "version": "2.1.0-beta.13",
3
+ "version": "2.1.0-beta.15",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -35,7 +35,7 @@
35
35
  "mongodb": "^6.12.0"
36
36
  },
37
37
  "dependencies": {
38
- "@apibara/indexer": "2.1.0-beta.13",
39
- "@apibara/protocol": "2.1.0-beta.13"
38
+ "@apibara/indexer": "2.1.0-beta.15",
39
+ "@apibara/protocol": "2.1.0-beta.15"
40
40
  }
41
41
  }
package/src/mongo.ts CHANGED
@@ -60,7 +60,9 @@ export async function cleanupStorage(
60
60
  // Delete all documents in the collection
61
61
  await db.collection(collection).deleteMany({}, { session });
62
62
  } catch (error) {
63
- throw new Error(`Failed to clean up collection ${collection}: ${error}`);
63
+ throw new Error(`Failed to clean up collection ${collection}`, {
64
+ cause: error,
65
+ });
64
66
  }
65
67
  }
66
68
  }