All lessons Leer en español

Security in depth · Unit 20 · Lesson 26 of 27

Errors need useful but limited detail

Turn an uncertain booking failure into useful messages for two audiences.

4 minreadyShort lesson

Helpful before thisWeb applications

See all lessons in this topic

After this lesson you can

  • Separate safe customer guidance from restricted diagnostic detail without overstating the outcome.

A useful error explains the next decision without exposing the internals.

One failure, two audiences

A member needs understandable status and a safe next action. Support needs enough detail to investigate. A correlation identifier connects related events so authorized staff can locate the appropriate diagnostic record. The identifier is a reference, not permission to read that record.

Detailed logs need access restrictions and deliberate data selection. Keeping a message off the public screen does not make passwords, session tokens, or unnecessary personal data acceptable logging material. Retention and responsibility for the record should also be defined.

Failure → Audience-specific detail → Protected diagnosisFailureAudience-specific detailProtected diagnosis
Audience-specific detail separates helpful guidance from protected diagnosis. Both views must preserve the same uncertainty about whether the operation completed.

Fictional failure packet

Assume a club creates reservations and has no documented automatic deduplication for a new attempt.

  • E1: The page cannot confirm whether Maya’s reservation completed; it displays “failed, try again.”
  • E2: Restricted diagnostics record reference R17, time 14:08, component “reservation response,” and category “timeout.” They do not establish whether the reservation committed.
  • E3: An authenticated “My reservations” view provides current booking status. Staff can investigate R17 through their protected support tool.

Rewrite without inventing certainty

The public message should say the result could not be confirmed, then direct Maya to check her reservations before another attempt. Include R17 for support. A timeout establishes missing timely confirmation, not necessarily a failed business operation.

The internal record can retain E2’s diagnostic fields and note that commitment is unknown. Record later verification as a separate observation rather than rewriting uncertainty into a fact. Staff access must remain authorized even when someone knows R17.

Model wording: “We could not confirm the result. Check your reservations before trying again; support reference R17.” Better wording does not repair the underlying failure.

Terms you met

Correlation identifier

Check yourself

No timer. No penalties. Read the explanation and try again whenever you like.

  1. Which customer message best matches E1-E3?

    Show the answer

    Correct answer: We could not confirm the result. Check your reservations before trying again; support reference R17. This states the observed uncertainty, avoids promising failure, and offers a next step without exposing internals.

Try it

  • WriteDraft a customer message and an internal record for E1-E3. Include the uncertainty, a safe next action, correlation reference, and one item that should never be logged.
References