fix(loggly): send more infos about cron errors

This commit is contained in:
Matteo Pagliazzi 2014-12-20 16:20:40 +01:00
parent 739d8885a3
commit 8b3c6f94bf

View file

@ -284,7 +284,13 @@ api.cron = function(req, res, next) {
User.findById(user._id, cb);
}
], function(err, saved) {
if(err) logging.loggly({error: "Cron caught", stack: err.stack || err});
if(err) logging.loggly({
error: "Cron caught",
stack: (err.stack || err.message || err),
body: req.body, headers: req.header,
auth: (req.headers['x-api-user'] + ' | ' + req.headers['x-api-key']),
originalUrl: req.originalUrl
});
res.locals.user = saved;
next(err,saved);
user = progress = quest = null;