I just wanted to ask if my concerns here are valid.
I am aware that it is unsafe for the API to return a stack trace. I have a similar, but less egregious, situation that I am trying to judge.
Is there also some standard regarding packaging up java exceptions into a 500 response? For example, sending back such things as "DataIntegrityViolationException," "NullPointerException," etc., but without the stack trace.
Worded another way, when an unhandled exception occurs, the exception name is sent back in the 500 response. There is no stack trace, but we can infer on the client-side if, for example, the request attempted to alter the DB in an invalid way.
I am currently warning my team against this and telling them that they should "whitelist" their server responses (i.e. only send content if you have a conscious reason for doing so). I just wanted to know if I am wasting their time with this.
Is this a good idea?
Or should it be more generic than this?