Skip to content

Commit

Permalink
Moved logic so that body parser errors are still logged to console in…
Browse files Browse the repository at this point in the history
… production env (just not sent w/ response)

refs #3347
  • Loading branch information
sgress454 committed Dec 23, 2015
1 parent 38f4e2e commit 39a65fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hooks/http/middleware/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ module.exports = function(sails, app) {
// is overridden in userland. Should probably be phased out at some point,
// since it could be accomplished more elegantly- btu for now it's practical.)
handleBodyParserError: function handleBodyParserError(err, req, res, next) {
var bodyParserFailureErrorMsg = 'Unable to parse HTTP body- error occurred :: ' + util.inspect((err&&err.stack)?err.stack:err, false, null);
sails.log.error(bodyParserFailureErrorMsg);
if (IS_PRODUCTION && sails.config.keepResponseErrors !== true) {
return res.send(400);
}
var bodyParserFailureErrorMsg = 'Unable to parse HTTP body- error occurred :: ' + util.inspect((err&&err.stack)?err.stack:err, false, null);
sails.log.error(bodyParserFailureErrorMsg);
return res.send(400, bodyParserFailureErrorMsg);
},

Expand Down

0 comments on commit 39a65fb

Please sign in to comment.