carbon-io / carbond

MIT License
2 stars 5 forks source link

Invalid JSON breaks body parser #41

Open willshulman opened 8 years ago

willshulman commented 8 years ago

Invalid json sent in body fails body parser in non-friendly way.

Should be able to get message out to client but we get this. Should re-test on latest Node.js

SyntaxError: Unexpected string at Object.parse (native) at parse (/Users/will/src/github/carbon-io/carbond/node_modules/body-parser/lib/types/json.js:84:17) at /Users/will/src/github/carbon-io/carbond/node_modules/body-parser/lib/read.js:102:18 at IncomingMessage.onEnd (/Users/will/src/github/carbon-io/carbond/node_modules/body-parser/node_modules/raw-body/index.js:149:7) at IncomingMessage.g (events.js:180:16) at IncomingMessage.EventEmitter.emit (events.js:92:17) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13)

willshulman commented 8 years ago

Related to https://github.com/carbon-io/carbond/issues/32

willshulman commented 8 years ago

Related to https://github.com/carbon-io/carbond/issues/40