Error components
Define custom error boundaries at route level:Error component props
Error components receive helpful props:Root error boundary
Catch errors from all routes:Throwing errors in loaders
Throw errors during data loading:Custom error types
Create typed errors for better handling:Component errors
Error boundaries also catch component errors:Resetting errors
Thereset function retries the failed operation:
Default error component
Use the built-in error component:Not found errors
Handle 404 errors separately:Error logging
Log errors to external services:Best practices
Provide helpful error messages
Provide helpful error messages
Give users context about what went wrong and how to recover.
Always include reset functionality
Always include reset functionality
Allow users to retry failed operations.
Use typed errors
Use typed errors
Create custom error classes for better error handling and recovery.
Log errors
Log errors
Integrate with error tracking services like Sentry or LogRocket.
Next steps
Data loading
Learn about loader error handling
Route API
Explore error configuration options