Skip to content

Commit

Permalink
fix issues with error object
Browse files Browse the repository at this point in the history
  • Loading branch information
brettneese committed Nov 6, 2015
1 parent 0b44c23 commit 9e84906
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/responses/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ module.exports.buildResponse = function (req, res, data, options, config) {
data = {detail: data};
}

if(data instanceof Error){
data = {detail: data.message};
data.debug.stack = data.stack;
}

// normalize that stuff, bro.

var jsonData = {
Expand All @@ -55,7 +50,9 @@ module.exports.buildResponse = function (req, res, data, options, config) {
},
meta: {
debug: { // an optional "debug" object that gets stripped in production
url: req.url // url that made the request
url: req.url, // url that made the request
message: data.message,
stack: data.stack
}
}
};
Expand Down

0 comments on commit 9e84906

Please sign in to comment.