Skip to content

Commit

Permalink
Adds sails.config.keepResponseErrors to preserve response error body …
Browse files Browse the repository at this point in the history
…in production mode.
  • Loading branch information
alivesay committed Apr 21, 2015
1 parent cce4ba9 commit 528a0b2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/hooks/responses/defaults/badRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function badRequest(data, options) {
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't
// send back any identifying information about errors.
if (sails.config.environment === 'production') {
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
data = undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/responses/defaults/forbidden.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function forbidden (data, options) {
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't
// send back any identifying information about errors.
if (sails.config.environment === 'production') {
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
data = undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/responses/defaults/notFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = function notFound (data, options) {
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't
// send back any identifying information about errors.
if (sails.config.environment === 'production') {
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
data = undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/hooks/responses/defaults/serverError.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = function serverError (data, options) {
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't
// send back any identifying information about errors.
if (sails.config.environment === 'production') {
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
data = undefined;
}

Expand Down

0 comments on commit 528a0b2

Please sign in to comment.