Which of the following is the best practice for error and exception handling?
Log detailed exception but display generic error message
Display detailed exception but log generic error message
Log and display detailed error and exception messages
Do not log or display error or exception messages
A detailed explanation of the error is not helpful for most end users but might provide information that is useful
to a hacker. It is therefore better to display a simple but helpful message to the end user and log the detailed
information to an access-restricted log file for the administrator and programmer who would need as much
information as possible about the problem in order to rectify it.