Skip to main content

Exercise: Error Boundary System

Objective

Create a comprehensive error handling system.

Requirements

1. Error Boundary Component

  • Catch component errors
  • Log to service
  • Show fallback UI
  • Reset functionality

2. Multiple Boundaries

  • App-level boundary
  • Feature-level boundaries
  • Component-level boundaries

3. Error Types

  • Network errors
  • Rendering errors
  • Async errors
  • 404 errors

4. Error Logging

  • Log error details
  • Send to error service (Sentry simulation)
  • Track error frequency
  • User session info

5. Recovery Strategies

  • Retry button
  • Redirect to home
  • Reload page
  • Show cached data

Bonus

  • Error analytics dashboard
  • Custom error pages per route
  • Development vs Production modes

Time Estimate

2-3 hours