You can clone with
HTTPS or Subversion.
if a client sends a request with content-length is incorrect (Ex: length less than the actual length), connect will throw runtime errors like this but good thing is it does not crash server:
Express server listening on port 3000
SyntaxError: Unexpected end of input
at Object.parse (native)
at IncomingMessage.<anonymous> (/Volumes/Data/Junk/myapp/node_modules/express/node_modules/connect/lib/middleware/json.js:76:27)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at process._tickCallback (node.js:415:13)
POST /users 400 7ms
Expected: would be great that connect can provide better errors, like throw back error object or something like that.
@jonathanong for your review. Thanks
okay so i don't think this is possible via connect because the error occurs at JSON.parse. obviously we don't know if it's valid JSON unless we parse it. i guess you're just going to have to google it if you get this error. not sure how to improve it except by catching this specific error and renaming it, which i'm not going to do.