You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just saw that even CastError returns 400. Basically it would be better if all mongoose related errors are put in 422 and if a field name is spelt wrong, or if the "id" specified is wrong a 400 will be better. So on the front end, all 422 errors, we can display the error message that comes with the response(examples - email already exists, passwords don't match,validation errors), whereas for 400 "the fault is with the client that sends the request" and we can display a generic error message like "something went wrong". So 400 errors need to be fixed on the frontend and 422 errors don't need fixing.
No description provided.
The text was updated successfully, but these errors were encountered: