feat: error-docs registry — stable per-exception URLs (ERR-4/DOC-6)#285
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ERR-4 + DOC-6 from the accepted 3.0 UX research rulings. Spec:
planning/changes/2026-07-07.06-error-docs-registry.md.ModernDIError.docs_slug+ a uniform trailingSee: https://modern-di.modern-python.org/troubleshooting/<slug>/line on everystr(exc)— composed through a_render_body()seam so dependency-path errors andValidationFailedError's grouped report keep their shapes (sub-errors render trailer-free; one outer trailer).DuplicateProviderTypeError's hand-rolled URL migrated, byte-identical.to-3.xsections instead.ModernDIErrorsubclass must have a unique slug AND an existing page — a new exception cannot ship undocumented.creator-call-errorfires 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 trailingSee:line; substring/match=assertions survive, full-equality assertions need the extra line.Gates:
just test-ci305 passed / 100% coverage,just docs-build--strict green,just lint-cigreen.