ER

Error Boundaries

UI error containment with Error Boundary patterns

Details

Language / Topic
_UUniversal
Category
Error Handling

Rules

balanced
- Use Error Boundary patterns for UI error containment. Prevent a single component crash from taking down the entire page.
- Implement fallback UIs that help users recover: retry buttons, navigation links, error descriptions.
- Place error boundaries at route and feature boundaries — each boundary should show a relevant fallback UI and report to error monitoring.
- Place error boundaries at strategic points: route level, feature level, and widget level.
- Log errors from boundaries to an error reporting service (Sentry, DataDog, etc.) with component stack traces.
- Reset boundary state on navigation — stale error states confuse users.
- Show appropriate fallback UIs per boundary: full-page error at route level, inline error at component level.