Skip to content

A database-backed application needs to stop showing detailed database errors to ordinary users while retaining information for investigation. Which approach best matches the lesson?

Answer

Use appropriate error handling and log database errors

Explanation

### Why this is right Appropriate error handling avoids exposing unnecessary database details to users, while logs preserve information that staff can review. The lesson recommends catching and logging SQL errors or unexpected behavior. ### The concept User-facing messages and internal records serve different purposes. A user usually needs a safe, understandable response, while authorized staff may need diagnostic details in logs. Monitoring those records can help reveal suspicious activity. ### The other options - **A. Show detailed errors to everyone**: this can disclose system details and does not improve error handling. - **C. Disable all logging**: this removes a source of information for investigation and monitoring. - **D. Give users database administrator access**: broad database permissions increase risk and do not solve error disclosure. ### Terms - **SQL**: Structured Query Language, used to interact with relational databases. - **Error handling**: deciding how software responds when an operation fails. - **Logging**: recording events for later review. ### Remember Keep user responses appropriate and preserve diagnostic information in controlled logs.

Related Questions

Want to practice more questions like this?

Join myBenkio free and practice past questions for your Nigerian university courses with AI explanations for every answer.

Start Practicing Free