Skip to content

Shape public-API error detail for validation and idempotency-key-reuse #17

@JumpTechCode

Description

@JumpTechCode

Two small improvements to the public error envelope (uniform {error, detail} shape):

  1. _validation_handler puts the full str(RequestValidationError) into detail, which is verbose and structural. Prefer a shaped form (reduced exc.errors()) or a fixed message.
  2. IdempotencyKeyReuse is raised with the raw key, so the 409 detail is a bare key token rather than a sentence. Consider e.g. f"idempotency key {key!r} reused with a different command".
  3. (Optional) ErrorResponse.detail is typed str; widen to str | None only if a null-detail path is introduced.

Files:

  • src/quartermaster/api/errors.py_validation_handler
  • src/quartermaster/application/envelope.pyIdempotencyKeyReuse raise site
  • src/quartermaster/api/schemas.pyErrorResponse

Deferred follow-up from the review of feat/api-http-layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions