Skip to content

Commit

Permalink
Minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie authored Apr 24, 2019
1 parent 4cd12bc commit 92d9356
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const handler = (req, res) => {
if (err) {
// eslint-disable-next-line no-console
console.error(err);
res.statusCode = err.status || err.statusCode || 500;
if (!res.headersSent) {
res.statusCode = err.status || err.statusCode || 500;
res.setHeader('Content-Type', 'application/json');
}
res.end(JSON.stringify({ errors: [{message: err.message}] }));
Expand Down

0 comments on commit 92d9356

Please sign in to comment.