Skip to content

Shared error-code taxonomy module #249

Description

@kilodesodiq-arch

Problem Statement. Error codes (e.g. INVALID_TOKEN, INTERNAL_SERVER_ERROR,
AI_SERVICE_ERROR, HTTP_500) are scattered: each handler constructs its own ad-hoc
envelope. error-handling.e2e-spec.ts shows the code field is number for backend
errors but string for AI service errors.

Why it matters. ADR-env consumers want a stable code mapping; an SDK round-trip
through AI service then backend fails without a normalized taxonomy.

Technical Context. src/common/filters/http-exception.filter.ts,
app/ai-service/schemas/errors.py.

Expected Outcome. A shared src/common/errors/codes.ts with ErrorCode = enum
membership, each code carrying human-readable description and HTTP status. Both repos
generate code from docs/errors.yaml.

Acceptance Criteria.

  • New module emits codes that are identical between backend and AI service.
  • Tests in both repos assert the same code for the same error class.

Files or modules likely to be affected.
new src/common/errors/codes.ts,
app/ai-service/schemas/errors.py.

Difficulty. Medium
Estimated effort. M



Backlog item #41 from `docs/maintainer-issue-backlog.md.

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions