#Express Error handling
9 messages · Page 1 of 1 (latest)
Share your code and describe the problem, then if someone can help they will
these are my current files, but i feel my error handeling isn't as concrete as it should be.\
what do you feel is wrong with it?
my error aren't concise as in, for an incorrect login, i have authentication error, invalid email or password, no user found. so many errors for the same thing and im also confused on throwing errors,. all in all, i just feel that it can be way cleaner and leaner
@long pebble appreciate the help btw
It's okay, they are all different errors though so it makes sense you would handle them differently.
I think for security reasons it might be better to return the same message 401 "invalid email or password" in the case of user not found as well (so the attacker doesn't know if they got a username that exists or not) but that's really nitpicky and 404 is also fine, depends on your application.
It really looks fine to me though, I'll let someone else chime in.
ok thank you, i just want to clean it all up because its confusing the hell outta me and i want to be able to generate the correct errors quickly and clean so i can move on to other things