Skip to content

feat: error-docs registry — stable per-exception URLs (ERR-4/DOC-6)#285

Merged
lesnik512 merged 2 commits into
mainfrom
feat/error-docs-registry
Jul 7, 2026
Merged

feat: error-docs registry — stable per-exception URLs (ERR-4/DOC-6)#285
lesnik512 merged 2 commits into
mainfrom
feat/error-docs-registry

Conversation

@lesnik512

Copy link
Copy Markdown
Member

ERR-4 + DOC-6 from the accepted 3.0 UX research rulings. Spec: planning/changes/2026-07-07.06-error-docs-registry.md.

  • Every concrete exception now carries a stable docs URL (Angular-NGxxxx-style): ModernDIError.docs_slug + a uniform trailing See: https://modern-di.modern-python.org/troubleshooting/<slug>/ line on every str(exc) — composed through a _render_body() seam so dependency-path errors and ValidationFailedError's grouped report keep their shapes (sub-errors render trailer-free; one outer trailer). DuplicateProviderTypeError's hand-rolled URL migrated, byte-identical.
  • The troubleshooting registry is complete: 16 new pages (5 existed) — one per class, fixed template (Symptom paraphrased, Cause, Fix, Escape hatches, canonical-concept link), each ≤213 words, dedupe discipline held. The three transitional warnings link their to-3.x sections instead.
  • Census test as a permanent gate: every concrete ModernDIError subclass must have a unique slug AND an existing page — a new exception cannot ship undocumented.
  • Review caught and fixed a factually inverted page before merge (creator-call-error fires on argument-binding failures; creator-body exceptions propagate unwrapped) and aligned the class docstring + catalog blurb that fed the confusion.

Note for downstream test suites (2.24.0-style): str() of every error gains a trailing See: line; substring/match= assertions survive, full-equality assertions need the extra line.

Gates: just test-ci 305 passed / 100% coverage, just docs-build --strict green, just lint-ci green.

lesnik512 added 2 commits July 7, 2026 22:57
Every concrete ModernDIError subclass now carries a class-level docs_slug;
__str__ appends a uniform "See: .../troubleshooting/<slug>/" trailer as the
final line, for the plain-message, dependency-path, and ValidationFailedError
grouped-report shapes alike. DuplicateProviderTypeError's hand-rolled inline
URL is replaced by the same mechanism (URL unchanged). The three transitional
warnings (UnvalidatedContainerWarning, ContainerClosedWarning,
ContextValueNoneWarning) now link the specific to-3.x.md section anchor for
their switch instead of the guide's landing page.

Census test (tests/test_docs_slug_census.py) asserts the slug half of the
completeness gate only — every concrete class has a unique docs_slug; Task 2
extends it with the page-existence assertion once the 16 new troubleshooting
pages land (noted in both the test and the spec).
@lesnik512 lesnik512 merged commit bb6a8e4 into main Jul 7, 2026
7 checks passed
@lesnik512 lesnik512 deleted the feat/error-docs-registry branch July 7, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant