I have an ASP.NET based API that needs to send http error codes from the server to the client as they occur. I do not wish to send the entire detailed stock error message containing the stacktrace to the user though, a simple "An error occurred" message will do.
The default behavior from IIS is to always send http 500 to non-local clients. I've gotten as far as to be able to send detailed error messages (with the error code); but is it possible to disable the details somehow?
If not, is it possible to add one custom error file I can use for all errors, and still send the specific error code to the client?