Skip to content

Standardize API error shape and centralize handling #141

@robertocarlous

Description

@robertocarlous

Body:

Controllers currently return varied error shapes. Create a single ApiError class (or similar) and ensure errorHandler middleware converts all thrown errors into a consistent JSON response with status, code, and message fields.

Acceptance Criteria:

  • ApiError exists and is used by controllers for expected failures.
  • errorHandler middleware returns consistent JSON schema: {status, code, message, details?}.
  • Tests verify that 400/401/403/404/500 responses follow the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions