node.js – How to get a more specific “why” of the error?

In my Node backend, I am using Express-validator to do some request body checks. For some reason if I include the code to check one of the form values, it will always give me an error “Invalid Value” (the default error message).

My question is: Is there any way to get more specifics about the error? From what I know about it, all I can get is which one it is throwing the error on, what the value is, and what the error is. But I can’t find why the value is invalid… and I can’t really fix it, if I don’t know why.

What should I do? I have looked at the API documentation for express-validator, but haven’t found anything that might help.

Read more here: Source link