Skip to content

Standardize validation error responses across all endpoints #35

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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