Skip to main content

Error handling covers PRD-specified edge cases

ab-001546 · goal-alignment.ux-alignment.error-handling-covers-prd-edge-cases
Severity: mediumactive

Why it matters

PRD-specified error states are requirements, not suggestions. When a user hits their usage quota and your app returns an unhandled 429 or a generic error page instead of the renewal prompt your PRD specified, you have broken the user experience the product owner signed off on. More critically, unhandled error paths often expose raw API error messages, stack traces, or internal IDs to end users — a violation of both good UX and basic information security hygiene. ISO 25010:2011 reliability requires that specified failure scenarios are handled gracefully, not just that happy paths work.

Severity rationale

Medium because unhandled PRD error states degrade user experience and may leak internal error details, but do not directly expose a security-critical attack vector.

Remediation

For each unhandled PRD error scenario, locate the triggering condition in your API route handlers and add the corresponding UI state. In a Next.js app, quota exceeded handling looks like:

// src/app/api/generate/route.ts
if (userUsage >= plan.limit) {
  return NextResponse.json(
    { error: 'quota_exceeded', upgradeUrl: '/pricing' },
    { status: 402 }
  )
}

Then handle it in the client component in src/components/ with a modal or inline message matching your PRD spec. Cross-check every error scenario in your PRD against the response codes your API routes actually return — the gap is usually in the client-side error boundary, not the server logic.

Detection

  • ID: goal-alignment.ux-alignment.error-handling-covers-prd-edge-cases
  • Severity: medium
  • What to look for: Enumerate every relevant item. Review the PRD for explicitly described error states, edge cases, or failure scenarios (e.g., "if the user's subscription expires, show a renewal prompt", "if the API fails, display a retry option", "if the user enters an invalid format, show inline validation"). Then check whether these specific error states are handled in the codebase. Look in form validation logic, API error handlers, and component error boundaries.
  • Pass criteria: At least 1 of the following conditions is met. All error states, edge cases, and failure scenarios that the PRD explicitly describes are handled in the implementation. Generic error handling (try/catch blocks, 404 pages, network error states) counts as coverage for generic error requirements.
  • Fail criteria: The PRD describes specific error scenarios that have no corresponding handling in the codebase. For example, the PRD says "show a friendly message when the user exceeds their usage quota" but no quota exceeded state exists in the UI.
  • Skip (N/A) when: The PRD contains no error state descriptions or edge case specifications. Signal: PRD is a simple feature list with no failure scenarios described.
  • Detail on fail: Name the specific unhandled PRD-described error scenarios. Example: "PRD specifies handling for expired subscription (show renewal modal) and rate limit exceeded (show retry countdown). Neither is implemented." Max 500 chars.
  • Remediation: Implement the missing error states described in your PRD. For each unhandled scenario, identify the triggering condition (API response code, data state, user action) in src/app/ route handlers and add the corresponding UI state. These are requirements, not nice-to-haves — your PRD already decided they matter enough to specify.

External references

Taxons

History