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 d6af0cc commit 8580d5bCopy full SHA for 8580d5b
lib/logger.js
@@ -14,10 +14,8 @@ InvalidJSON.prototype.status = 400
14
15
router.use(function jsonBodyParser(req, res, next) {
16
express.json({ ...cds.env.server.body_parser }) (req, res, function http_body_parser_next(err) {
17
- if (err) { // Need to wrap, as a rethrow would crash the server
18
- let e = new InvalidJSON(err.message)
19
- return next(e)
20
- }
+ // Need to wrap, as CAP server deliberately crashes on SyntaxErrors
+ if (err) return next(new InvalidJSON(err.message)
21
next()
22
})
23
0 commit comments