A developer is designing a web application and wants to ensure that detailed error messages do not expose sensitive system information to potential attackers. Which approach should the developer take when implementing error handling for the web application to enhance security?
Redirect the user to the home page whenever an error occurs without displaying any message.
Display a generic error message to the user and log the details of the error internally for review by developers.
Provide detailed error messages including system architecture and software version numbers.
Customize HTTP response codes to indicate the specific type of error that occurred.