Problem
Error responses are inconsistent across endpoints. Some return { success: false, error: string }, others return different formats from the error handler middleware.
Context
API consumers must handle multiple response formats, increasing client complexity.
Proposed Solution
Define a standard error response:
interface ErrorResponse {
success: false;
error: {
code: string;
message: string;
details?: unknown;
};
requestId?: string;
}
Acceptance Criteria
Technical Notes
- Files:
api/src/middleware/errorHandler.ts, api/src/types/index.ts
Constraints
- Backward compatible (keep
success field)
Problem
Error responses are inconsistent across endpoints. Some return
{ success: false, error: string }, others return different formats from the error handler middleware.Context
API consumers must handle multiple response formats, increasing client complexity.
Proposed Solution
Define a standard error response:
Acceptance Criteria
Technical Notes
api/src/middleware/errorHandler.ts,api/src/types/index.tsConstraints
successfield)