Skip to content

Commit 6fbafc5

Browse files
committed
Pretty print JSON error response
1 parent 8a41c06 commit 6fbafc5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
unreleased
22
==========
33

4+
* Pretty print JSON error response
45
* perf: resolve file paths at start up
56

67
1.4.3 / 2016-01-17

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ exports = module.exports = function errorHandler(options) {
147147
} else if (type === 'json') {
148148
var error = { message: err.message, stack: err.stack };
149149
for (var prop in err) error[prop] = err[prop];
150-
var json = JSON.stringify({ error: error });
150+
var json = JSON.stringify({ error: error }, null, 2)
151151
res.setHeader('Content-Type', 'application/json; charset=utf-8')
152152
res.end(json);
153153
// plain text

0 commit comments

Comments
 (0)