Skip to content

Standardize validation error responses across all endpoints #35

@djdiptayan1

Description

@djdiptayan1

Description:
Different endpoints return validation errors in different formats, making it difficult for frontend applications to handle errors consistently.

Current Issues:

  • Inconsistent error message formats
  • Some endpoints return HTML errors instead of JSON
  • Missing field-level validation details
  • Error codes are not standardized
  • No client-friendly error messages

What needs to be fixed:

  • Standardize error response format
  • Ensure all endpoints return JSON errors
  • Add field-level validation details
  • Implement consistent error codes
  • Add user-friendly error messages

Acceptance Criteria:

  • All validation errors follow same format
  • Only JSON responses are returned
  • Field-level errors are included
  • Error codes are consistent
  • Error messages are user-friendly

Files to modify:

  • All controller files
  • src/middleware/errorMiddleware.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions