Which of the following statements is NOT true regarding Error Handling and Logging?

  1. Never rely on the operating system, database, or hardware to handle errors

  2. Your application’s code should always include its own error handler.

  3. All errors generated by internal components such as system calls, database queries, and other internal functions, should be handled by the application’s exception handler

  4. Never implement a generic error page


Correct Option: D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Never rely on the operating system, database, or hardware to handle errors - This option is true. It is generally not recommended to rely solely on external components such as the operating system, database, or hardware to handle errors. Your application should include its own error handling mechanism to handle any errors that may occur.

Option B) Your application’s code should always include its own error handler - This option is true. It is good practice to include error handling code within your application to handle any potential errors that may occur during its execution. This allows you to control the behavior and response of your application when an error occurs.

Option C) All errors generated by internal components such as system calls, database queries, and other internal functions, should be handled by the application’s exception handler - This option is true. It is important to handle errors generated by internal components within your application. By having a centralized exception handler, you can catch and handle these errors in a consistent and controlled manner.

Option D) Never implement a generic error page - This option is NOT true. Implementing a generic error page can be a good practice to provide a user-friendly and informative error message to users when an unexpected error occurs. It can help users understand what went wrong and provide suggestions or instructions on how to proceed. Therefore, the correct answer is D.

The correct answer is D. This option is incorrect because implementing a generic error page can be a helpful approach in error handling and logging strategies.

Find more quizzes: