Skip to content

Commit

Permalink
Output server errors as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sashachabin committed Jul 27, 2022
1 parent 58e4849 commit 88cd470
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ http
res.end()
} catch (error) {
res.writeHead(400, defaultHeaders)
res.write(JSON.stringify({ error }))
res.write(error.message)
res.end()
}
} else {
res.writeHead(404, defaultHeaders)
res.write(JSON.stringify({ error: 'Not found' }))
res.write('Not found')
res.end()
}
})
Expand Down

0 comments on commit 88cd470

Please sign in to comment.