You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace ad-hoc error handling with a structured error class hierarchy, consistent error response format, and error correlation IDs throughout the backend.
Motivation
Current error handling is inconsistent: some routes throw plain Error objects, others return inline error responses. This makes debugging and client-side error handling difficult.
Acceptance Criteria
Base AppError class with: code, message, statusCode, details, correlationId
Specific error classes: NotFoundError, ValidationError, AuthenticationError, RateLimitError, PaymentError
All errors include correlation ID matching request ID
Summary
Replace ad-hoc error handling with a structured error class hierarchy, consistent error response format, and error correlation IDs throughout the backend.
Motivation
Current error handling is inconsistent: some routes throw plain Error objects, others return inline error responses. This makes debugging and client-side error handling difficult.
Acceptance Criteria
AppErrorclass with: code, message, statusCode, details, correlationIdNotFoundError,ValidationError,AuthenticationError,RateLimitError,PaymentError{ error: { code, message, details, correlationId, timestamp } }Files to Modify
backend/src/errors/AppError.tsbackend/src/errors/NotFoundError.tsbackend/src/errors/ValidationError.tsbackend/src/errors/AuthenticationError.tsbackend/src/errors/RateLimitError.tsbackend/src/api/middleware/errorHandler.tsbackend/src/api/routes/tasks.tsbackend/src/api/routes/agents.tsbackend/src/errors/AppError.test.tsHow to Contribute
feat/structured-error-handlingnpm run test && npm run lintbefore submitting PR