-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
FrontendNexjsNexjs
Description
📌 Overview
Implement a centralized API error interceptor to normalize backend error responses and provide consistent UI handling.
🧠 Background
Currently, API errors are handled individually across components, which leads to inconsistent messaging and duplicated logic.
📐 Specifications
- Use a single API client instance
- Normalize error structure
- Handle:
- network errors
- timeout errors
- 4xx & 5xx responses
- Return a typed error object
🛠 Tasks
- Create interceptor in
lib/api.ts - Implement
parseApiError()utility - Refactor existing API calls to use the client
📂 Impacted Files
- lib/api.ts
- utils/error-handler.ts
- All async data-fetching components
🏷 Labels
frontend error-handling DX high-priority
🤝 Contribution Guidelines
- Follow project ESLint & Prettier rules
- Use TypeScript types for error objects
✅ Acceptance Criteria
- All API errors pass through the interceptor
- UI receives a consistent error format
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrontendNexjsNexjs