Merge pull request #2512 from colegleason/version-error

chore(VersionError): add debug code to emails showing completed ops
This commit is contained in:
Tyler Renelle
2014-01-21 22:57:01 -08:00
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -437,10 +437,12 @@ api.batchUpdate = function(req, res, next) {
api[_req.op](_req, res);
};
res.locals.ops = [];
// Setup the array of functions we're going to call in parallel with async
var ops = _.transform(req.body, function(result, _req) {
if (!_.isEmpty(_req)) {
result.push(function(cb) {
res.locals.ops.push(_req);
callOp(_req, cb);
});
}
+2 -1
View File
@@ -66,7 +66,8 @@ module.exports.errorHandler = function(err, req, res, next) {
"\n\noriginalUrl: " + req.originalUrl +
"\n\nauth: " + req.headers['x-api-user'] + ' | ' + req.headers['x-api-key'] +
"\n\nheaders: " + JSON.stringify(req.headers) +
"\n\nbody: " + JSON.stringify(req.body);
"\n\nbody: " + JSON.stringify(req.body) +
(res.locals.ops ? "\n\ncompleted ops: " + JSON.stringify(res.locals.ops) : "");
module.exports.sendEmail({
from: "HabitRPG <" + nconf.get('SMTP_USER') + ">",
to: nconf.get('ADMIN_EMAIL') || nconf.get('SMTP_USER'),