User Story
As a developer, I want a standardized error handling mechanism for all API endpoints, so that clients receive consistent, machine-readable error responses regardless of which endpoint they call.
Parent Epic
EPIC-02: Application Shell & Infrastructure (#2)
Priority
Must Have
Dependencies
None
Acceptance Criteria
Notes
- The error shape is defined in CLAUDE.md under API Conventions
- This is a cross-cutting concern that all downstream feature epics rely on for consistent API behavior
- The error codes and HTTP status mapping should be defined in the shared package for reuse by the API client (Story 2.6)
User Story
As a developer, I want a standardized error handling mechanism for all API endpoints, so that clients receive consistent, machine-readable error responses regardless of which endpoint they call.
Parent Epic
EPIC-02: Application Shell & Infrastructure (#2)
Priority
Must Have
Dependencies
None
Acceptance Criteria
{ "error": { "code": "MACHINE_READABLE_CODE", "message": "Human-readable", "details": {} } }VALIDATION_ERRORcode and include field-level detailsINTERNAL_ERRORcode and do NOT leak stack traces or internal details in productionNOT_FOUND(404),UNAUTHORIZED(401),FORBIDDEN(403),CONFLICT(409),VALIDATION_ERROR(400)throw new AppError('NOT_FOUND', 'Work item not found'))Notes