Skip to content

Application stops after JSON request with wrong json object #1785

@sjorobekov

Description

@sjorobekov

I send HTTP POST request (Content-type: application/json)

{ foo: "bar"} instead of {"foo" : "bar"}

Application stops with message:

SyntaxError: Unexpected token f
at Object.parse (native)
at IncomingMessage. (C:\Users\Samat\WebstormProjects\express-taxi
\node_modules\express\node_modules\connect\lib\middleware\json.js:76:27)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

It's uncomfortable if application stops each time client send wrong json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions