-
Notifications
You must be signed in to change notification settings - Fork 0
Handle database outages gracefully #62
Copy link
Copy link
Open
Labels
backendIssue related to backendIssue related to backendbugSomething isn't workingSomething isn't workingconfigurationConfigurations at code and project levelConfigurations at code and project levelenhancementNew feature or requestNew feature or requestfrontendIssue related to frontendIssue related to frontend
Milestone
Metadata
Metadata
Assignees
Labels
backendIssue related to backendIssue related to backendbugSomething isn't workingSomething isn't workingconfigurationConfigurations at code and project levelConfigurations at code and project levelenhancementNew feature or requestNew feature or requestfrontendIssue related to frontendIssue related to frontend
Projects
Status
No status
Possible approach:
Health Check API Endpoint
Created /api/health endpoint that returns current service status
Returns structured health data including database connection state
Uses HTTP status codes (200 for healthy, 503 for unhealthy)
Custom Error Handling System
Created lib/errors.ts with comprehensive error classification:
DATABASE_CONNECTION_ERROR (503) - Connection refused/failed
DATABASE_TIMEOUT_ERROR (504) - Operation timeouts
SERVICE_UNAVAILABLE (503) - General service issues
Handle it in the UI by redirecting to service unavailable page.