Merged
Conversation
…or handling - Introduced ErrorBoundary component to catch JavaScript errors in child components and display a fallback UI. - Added ErrorFallback component for user-friendly error display, featuring a clean design and options to reset the error state or navigate to the dashboard. - Implemented higher-order component `withErrorBoundary` to wrap components with error handling capabilities. - Updated index file to export the new components for easy access.
… components - Added Error component for handling runtime errors at the route segment level, featuring a user-friendly UI and reset functionality. - Introduced GlobalError component as a catch-all error boundary for critical errors in the root layout, ensuring a consistent user experience across the application. - Created a centralized errors utility module for structured error handling, including functions for categorizing and logging errors, as well as parsing Supabase errors into user-friendly messages.
- Introduced NetworkStatusProvider component to monitor the browser's online/offline status and provide context to child components. - Implemented useNetworkStatus hook for easy access to network status. - Added toast notifications for network status changes, enhancing user experience. - Updated English and Spanish localization files with network-related error messages.
- Updated the Providers component to include NetworkStatusProvider, enhancing the app's ability to monitor online/offline status for child components.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR implements a comprehensive global error handling system for the application. It includes a React Error Boundary for catching component-level crashes, Next.js error pages for route-level failures, centralized error utilities, and real-time network status monitoring with user feedback.
🔗 Related Issue
Closes #27
🏷️ Type of Change
🔄 Changes Made
ErrorBoundaryandErrorFallbackincomponents/errors/to catch JavaScript errors and display a consistent UI with retry/reset capabilities.app/error.tsxandapp/global-error.tsxto handle runtime errors at both the route segment and root layout levels.lib/errors.tsfor parsing Supabase errors, detecting network/offline states, and providing development-mode logging.NetworkStatusProviderto monitornavigator.onLineand show toast notifications when the connection is lost or restored.en.jsonandes.jsonfor all new components and scenarios.Providerscomponent and app structure.🧪 Testing
npm run build).✅ Checklist
📸 Screenshots (if applicable)
(Screenshots of the ErrorFallback and Network Toasts should be added here)
📌 Additional Notes
The
global-error.tsxuses inline styles as a failsafe because it might be triggered when Tailwind or other CSS providers fail to load. In development mode, detailed error messages and stack traces are displayed to facilitate debugging.