We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a41c06 commit 6fbafc5Copy full SHA for 6fbafc5
HISTORY.md
@@ -1,6 +1,7 @@
1
unreleased
2
==========
3
4
+ * Pretty print JSON error response
5
* perf: resolve file paths at start up
6
7
1.4.3 / 2016-01-17
index.js
@@ -147,7 +147,7 @@ exports = module.exports = function errorHandler(options) {
147
} else if (type === 'json') {
148
var error = { message: err.message, stack: err.stack };
149
for (var prop in err) error[prop] = err[prop];
150
- var json = JSON.stringify({ error: error });
+ var json = JSON.stringify({ error: error }, null, 2)
151
res.setHeader('Content-Type', 'application/json; charset=utf-8')
152
res.end(json);
153
// plain text
0 commit comments