Conversation
Sync-up PR (Jun Han)
Sync-up PR (Jun Han)
Prakhar896
left a comment
There was a problem hiding this comment.
Generally well-written; please remember that for caught exceptions in a try-catch are meant to be Logger.loged with the error message of the caught exception. In all other scenarios, there should just be a ERROR or UERROR response to the client, no console.logs.
Prakhar896
left a comment
There was a problem hiding this comment.
Please try to keep in mind the whole project when coding; high cognitive and logical reasoning is a requirement to write good, reliable and secure code.
|
|
||
| try { | ||
| await changePasswordSchema.validate(req.body); | ||
| const data = await changePasswordSchema.validate(req.body, { abortEarly: false }); |
There was a problem hiding this comment.
If validation fails, yup will throw an array of errors (because you configured it to not abortEarly) which will be caught by your catch block. But, your catch block is considering it to be an internal server error, which is misleading. Must be changed in the next PR. @JunHammy
What was done in this PR
New features description