test: log e11000 errors

This commit is contained in:
Barış Soner Uşaklı
2023-07-15 23:30:19 -04:00
parent 052f1f2232
commit 934df69e9d
4 changed files with 12 additions and 6 deletions

View File

@@ -443,7 +443,8 @@ module.exports = function (module) {
// https://github.com/NodeBB/NodeBB/issues/4467
// https://jira.mongodb.org/browse/SERVER-14322
// https://docs.mongodb.org/manual/reference/command/findAndModify/#upsert-and-unique-index
if (err && err.message.startsWith('E11000 duplicate key error')) {
if (err && err.message.includes('E11000 duplicate key error')) {
console.log(new Error('e11000').stack, key, increment, value);
return await module.sortedSetIncrBy(key, increment, value);
}
throw err;