Add error boundaries to all SDK route pages #25

Open
opened 2026-04-20 09:37:48 +00:00 by sharang · 0 comments
Owner

Problem

SDK pages in admin-compliance/app/(sdk)/ do not have error boundaries. If any component throws an uncaught error (network failure, null data, unexpected API shape), the entire page goes blank with no user-facing message. React's default behavior in production is to unmount the whole tree.

Required Actions

  1. Create admin-compliance/components/sdk/ErrorBoundary.tsx — class component with componentDidCatch that renders a fallback UI
  2. Wrap every SDK route layout in the error boundary:
    • app/(sdk)/layout.tsx — wraps all SDK pages
    • Individual pages with complex data fetching can add inner boundaries
  3. Fallback UI should show: service name, generic error message, retry button
  4. Log caught errors to a structured logger (console.error with context in dev, error tracking service in prod)

Acceptance Criteria

  • Simulated API failure shows a friendly error state, not a blank page
  • Error boundary catches thrown errors in child components
  • Fallback includes a user-actionable recovery option (retry / go to dashboard)
## Problem SDK pages in `admin-compliance/app/(sdk)/` do not have error boundaries. If any component throws an uncaught error (network failure, null data, unexpected API shape), the entire page goes blank with no user-facing message. React's default behavior in production is to unmount the whole tree. ## Required Actions 1. Create `admin-compliance/components/sdk/ErrorBoundary.tsx` — class component with `componentDidCatch` that renders a fallback UI 2. Wrap every SDK route layout in the error boundary: - `app/(sdk)/layout.tsx` — wraps all SDK pages - Individual pages with complex data fetching can add inner boundaries 3. Fallback UI should show: service name, generic error message, retry button 4. Log caught errors to a structured logger (console.error with context in dev, error tracking service in prod) ## Acceptance Criteria - Simulated API failure shows a friendly error state, not a blank page - Error boundary catches thrown errors in child components - Fallback includes a user-actionable recovery option (retry / go to dashboard)
sharang added this to the M5: Frontend Hardening milestone 2026-04-20 09:37:48 +00:00
sharang added the reliabilityfrontendseverity: medium labels 2026-04-20 09:37:48 +00:00
Sign in to join this conversation.