Skip to content

[finding] content/docs/protocol/kernel/error-handling.mdx documents DUPLICATE_RECORD as a 409 HTTP response code, while every route reports the conflict as UNIQUE_VIOLATION #15362

Description

@os-justin

Observation recorded while implementing #14723 (maintainer ruling A: a unique-constraint refusal has ONE wire spelling on every route, UNIQUE_VIOLATION; the engine's thrown DuplicateRecordError.code stays DUPLICATE_RECORD in-process). Filed unassigned; not addressed by the #14723 PR, whose surface is code, pins and changesets.

What the page says

content/docs/protocol/kernel/error-handling.mdx, section ## Error Codes / ### Resource Errors, at line 349 on origin/main 2ed6be649:

  • #### DUPLICATE_RECORD — "HTTP Status: 409", "Meaning: Resource with unique constraint already exists", with an example HTTP body whose error.code is "DUPLICATE_RECORD" (and a details object carrying resource / constraint / field / value).
  • Line 950, in the rate-limiting section: // Response: "DUPLICATE_RECORD" or "VALIDATION_ERROR" for a registration attempt.

What the platform does

So the error-handling page describes a wire body no route emits, and the example's details.value echoes the offending value, which the platform sentence deliberately withholds (the driver's error stays on cause).

Not measured here

  • Whether the { "success": false, "error": { ... } } envelope shape on that page matches today's ADR-0112 body at all — the whole section may predate the current envelope; this card records only the code spelling.
  • Whether content/docs/api/error-catalog.mdx line 355 (### DUPLICATE_RECORD, "A record with the same unique key already exists") needs a note distinguishing the in-process code from the wire spelling; it is a catalog entry, not an HTTP example, so it may be fine as-is.

Suggested disposition

Docs-only: rewrite the DUPLICATE_RECORD entry on error-handling.mdx to say the 409 wire body carries UNIQUE_VIOLATION (cross-reference http-protocol.mdx), keep DUPLICATE_RECORD documented as the engine-envelope code an in-process caller branches on, and drop the value echo from the example. Leave for triage to grade.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions