wingbot-mongodb 3.2.3 → 3.2.4

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": "wingbot-mongodb",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "MongoDB storage for wingbot.ai",
5
5
  "main": "src/main.js",
6
6
  "scripts": {
@@ -330,7 +330,6 @@ class BaseStorage {
330
330
  fixtures = fixtures
331
331
  .filter((f) => !f._id || !found.includes(f._id.toString()));
332
332
  }
333
-
334
333
  }
335
334
 
336
335
  if (!updated || fixtures.length === 0) {
@@ -342,7 +341,9 @@ class BaseStorage {
342
341
  .then(() => collection.insertOne(o))
343
342
  .then(() => this._log.log(`DB.${this._collectionName} Inserted fixture doc to "${this._collectionName}"`))
344
343
  .catch((e) => {
345
- if (e.code !== 11000) {
344
+ if (e.code === 11000) {
345
+ this._log.log(`DB.${this._collectionName} fixture not inserted: ${e.message}`);
346
+ } else {
346
347
  this._log.error(`DB.${this._collectionName} failed to insert fixture doc to "${this._collectionName}"`, e);
347
348
  }
348
349
  }),