Wiredcraft / test-fullstack

6 stars 43 forks source link

Error handling, it could be the user's input has issue or server failed to create the comment, so might be better to treat them differently with 4xx and 5xx codes. #46

Closed ammadtarar closed 3 years ago

ammadtarar commented 4 years ago

Error handling, it could be the user's input has issue or server failed to create the comment, so might be better to treat them differently with 4xx and 5xx codes.

_Originally posted by @rankun203 in https://github.com/_render_node/MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDQ0MDY0MjI0Mw==/comments/review_comment_

ammadtarar commented 4 years ago

First , req.user.id is coming from my middleware. When user sends token in headers , middleware tries to get user id for corresponding token . But ive added literal escape here now .