chore(VersionError): add debug code to emails showing completed ops

This adds a field to the email if there is an error on batchUpdate. This
field contains all the attempted operations. So the last item in the
list would be the operation that we encountered the error at. @lefnire,
mind taking a look at this and pushing if you feel comfortable with
adding more to the emails?
This commit is contained in:
Cole Gleason
2014-01-22 00:50:14 -06:00
parent 5ddf09fe13
commit 187ea1c739
2 changed files with 4 additions and 1 deletions
+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'),