Node.js based forum software built for the modern web
fix: log error to prevent headers already sent
Barış Soner Uşaklıa22a3a9861a3
diff --git a/src/controllers/topics.js b/src/controllers/topics.jsindex 6e2f72785c..d5bdffbb3f 100644--- a/src/controllers/topics.js+++ b/src/controllers/topics.js@@ -3,6 +3,7 @@var async = require('async');var nconf = require('nconf');+var winston = require('winston');var user = require('../user');var meta = require('../meta');@@ -172,7 +173,7 @@ topicsController.get = function getTopic(req, res, callback) {if (req.loggedIn) {topics.markAsRead([tid], req.uid, function (err, markedRead) {if (err) {- return callback(err);+ return winston.error(err);}if (markedRead) {topics.pushUnreadCount(req.uid);diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.jsindex 7d628d9b69..97f8371a35 100644--- a/src/database/mongo/sets.js+++ b/src/database/mongo/sets.js@@ -55,6 +55,9 @@ module.exports = function (db, module) {}bulk.execute(function (err) {+ if (err && err.message.startsWith('E11000 duplicate key error')) {+ return process.nextTick(module.setsAdd, keys, value, callback);+ }callback(err);});};