In error handling, how should user-facing errors differ from system errors and how should they be logged?

Enhance your coding skills with the Code Standards and Practices Level 3 Test. Access well-crafted questions, insightful explanations, and progress tracking to master this exam. Prepare effectively for your Level 3 certification with our comprehensive study materials!

Multiple Choice

In error handling, how should user-facing errors differ from system errors and how should they be logged?

Explanation:
In error handling, the user should see something friendly and non-technical, while the developer side keeps the detailed information needed to diagnose the problem. User-facing errors should reveal minimal information—just enough to tell the user something went wrong and perhaps what they can do next—without exposing internal details like stack traces, file paths, or configuration specifics. This protects security and avoids confusing users with technical jargon. Meanwhile, system-level logs are where the full diagnostic data belongs. These logs should capture detailed traces, error types, timestamps, and relevant context that helps developers reproduce and fix the issue. They must be stored securely, with access controls, and should avoid leaking sensitive user data. To bridge user experience and debugging needs, an error ID can be shown to the user and used to look up the exact log entry in the secure system. The other options fail because showing stack traces to users leaks internals; displaying system errors to users exposes sensitive information; and logging all errors with full user data risks privacy and security.

In error handling, the user should see something friendly and non-technical, while the developer side keeps the detailed information needed to diagnose the problem. User-facing errors should reveal minimal information—just enough to tell the user something went wrong and perhaps what they can do next—without exposing internal details like stack traces, file paths, or configuration specifics. This protects security and avoids confusing users with technical jargon.

Meanwhile, system-level logs are where the full diagnostic data belongs. These logs should capture detailed traces, error types, timestamps, and relevant context that helps developers reproduce and fix the issue. They must be stored securely, with access controls, and should avoid leaking sensitive user data. To bridge user experience and debugging needs, an error ID can be shown to the user and used to look up the exact log entry in the secure system.

The other options fail because showing stack traces to users leaks internals; displaying system errors to users exposes sensitive information; and logging all errors with full user data risks privacy and security.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy