-
Notifications
You must be signed in to change notification settings - Fork 36
Feature: Standardize API error response format #69
Copy link
Copy link
Open
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programapiREST API componentREST API componenteasyDifficulty: EasyDifficulty: EasyenhancementNew feature or requestNew feature or request
Description
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
- All error responses follow the same schema
- Error codes defined and documented
- Error handler middleware produces standard format
- Tests verify error response structure
Technical Notes
- Files:
api/src/middleware/errorHandler.ts,api/src/types/index.ts
Constraints
- Backward compatible (keep
successfield)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave programapiREST API componentREST API componenteasyDifficulty: EasyDifficulty: EasyenhancementNew feature or requestNew feature or request