THE GITHTML FIELD GUIDE

Check an AI-generated error catalog against real public responses

Compare an AI-generated error catalog with the actual public response contract and controlled tests. Verify stable identifiers, status mappings, triggering conditions, and recovery guidance separately. Do not publish internal exception names as public errors or infer that retrying is safe merely because the draft labels a failure temporary.

Identify the public boundary of each error

Collect the catalog's claimed codes, statuses, messages, and problem types, then trace where responses leave the application. An internal exception may be caught, transformed, or deliberately hidden before reaching a caller. The AI draft may have read a class name and presented it as a public contract. Record the endpoint or operation scope and software version. Distinguish stable identifiers from human-readable messages that can change. If the service uses a standard problem format, confirm which fields and extensions it actually exposes rather than assuming every field from an example specification is present.

Map conditions and transformations explicitly

For each draft entry, locate the originating condition, handler mapping, and serialized response. Use tests or approved safe fixtures to verify representative paths. The scaffold below keeps source evidence and observation separate. Check whether multiple internal failures intentionally map to one public response and whether authorization errors avoid revealing sensitive resource details. Do not generate a new public error taxonomy during a documentation review; unresolved behavior belongs with the service owner. If a draft suggests retrying, verify idempotency, partial completion, and provider-specific instructions before accepting the advice. A syntactically correct JSON example can still teach an unsafe recovery sequence.

text
Draft error entry:
Public operation:
Internal source condition:
Handler mapping:
Observed response:
Stable identifier:
Retry / partial-completion evidence:
Sensitive fields excluded:
Correction or open question:

Review completeness without inventing certainty

Compare the public catalog with known handled conditions and identify gaps as questions, not fabricated entries. Label undocumented or unstable behavior appropriately while maintainers decide the contract. Use synthetic values in examples and remove stack traces, credentials, and customer identifiers. Re-run checks when error handling changes, even if endpoint signatures do not. Keep the final catalog focused on what callers can observe and act upon. The goal is not to produce the longest possible list of failures; it is to give readers accurate distinctions between correctable input, authorization problems, transient conditions, and outcomes that require reconciliation or human support. Include a case where the response is intentionally nonspecific for security reasons. The documentation should explain the caller's permitted next step without promising details the service deliberately withholds.

  1. Trace each draft error from internal cause to public serialization.
  2. Verify stable identifiers, status mapping, and operation scope independently.
  3. Use controlled failures and inspect partial-completion or retry assumptions.
  4. Mark gaps for owner review instead of inventing a complete-looking catalog.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All working with ai-written docs guides →

Read as MarkdownAll guides

Check an AI-generated error catalog against real public responses · gitHtml