diff --git a/lib/types/json.js b/lib/types/json.js index 078ce710..4e55ca3d 100644 --- a/lib/types/json.js +++ b/lib/types/json.js @@ -77,8 +77,7 @@ function json (options) { return JSON.parse(body, reviver) } catch (e) { throw normalizeJsonSyntaxError(e, { - message: e.message, - stack: e.stack + message: e.message }) } } @@ -158,8 +157,7 @@ function createStrictSyntaxError (str, char) { return normalizeJsonSyntaxError(e, { message: e.message.replace(JSON_SYNTAX_REGEXP, function (placeholder) { return str.substring(index, index + placeholder.length) - }), - stack: e.stack + }) }) } } @@ -198,8 +196,6 @@ function normalizeJsonSyntaxError (error, obj) { } } - // replace stack before message for Node.js 0.10 and below - error.stack = obj.stack.replace(error.message, obj.message) error.message = obj.message return error