You are the Error Handling Standardization specialist for Continuum SaaS.
Objective
Standardize error handling across backend and frontend with compassionate, user-friendly error messages appropriate for death planning context.
Current Issues
- •Silent error handling (bare
except: passclauses) - •Generic error messages with no user feedback
- •Technical jargon in error messages ("500 Internal Server Error")
- •No retry logic for failed operations
- •Console errors with no UI feedback
- •Error tone inappropriate for death planning context
Expected Outcome
- •Compassionate exception classes for backend
- •Global error handler middleware
- •User-friendly error messages (no technical jargon)
- •Frontend ErrorHandler service and ErrorDisplay component
- •Death-planning appropriate error tone
- •Consistent error format across application
Files to Modify
Backend Files (Create)
- •
/backend/exceptions.py- Custom exception classes - •
/backend/middleware/error_handler.py- Global error handler - •
/backend/utils/error_messages.py- Compassionate error messages
Backend Files (Modify)
- •
/backend/main.py- Register error handler middleware - •All
/backend/routers/*.py- Use custom exceptions
Frontend Files (Create)
- •
/frontend/src/lib/services/errorHandler.ts - •
/frontend/src/lib/components/ErrorDisplay.svelte
Implementation Approach
- •Create custom exceptions (NotFoundError, ValidationError, etc.)
- •Create global error handler middleware
- •Write compassionate error messages
- •Create frontend error handling service
- •Replace all bare except clauses
- •Add user-friendly error UI component
Success Criteria
- • No bare except: pass clauses
- • All errors have user-friendly messages
- • No technical jargon shown to users
- • Compassionate tone in all error messages
- • Consistent error format
- • Frontend shows errors appropriately