docs(errors): document exception hierarchy and enrich Errors reference page#168
Merged
Conversation
Fill in docstrings for the exception hierarchy in pyrewire._core.errors: the five previously-undocumented classes (InvalidIRError, ExecError, WirelogIOError, CompoundSaturatedError, CompoundBusyError) and expand the terse ones. Each states its WIRELOG_ERR_* code and when it is raised; ExecError is documented as the catch-all (invalid args, closed/null handles, missing relations). ParseError gains an Attributes section for its best-effort line/column/source payload. Fix the module docstring miscount (Two -> Three PyreWire-only exceptions). Add a self-discovering test asserting every WirelogError subclass defined in the module carries its own non-trivial (>=30 char) docstring. Refs #167
|
|
||
| import pytest | ||
|
|
||
| import pyrewire._core.errors as _errors_module |
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.
Resolves #167.
Improves the Errors reference documentation in two atomic commits, produced via a consensus-gated implementation flow (architect+critic guidance → implementer → reviewer → architect+critic audit → consensus).
Changes
Unit 1 —
199372a— docstrings + presence testInvalidIRError,ExecError,WirelogIOError,CompoundSaturatedError,CompoundBusyError) and expands the terse ones; each cites itsWIRELOG_ERR_*code and when it is raised.ExecErrordocumented as the catch-all (invalid args, closed/null handles, missing relations).ParseErrorgains anAttributes:section for its best-effortline/column/sourcepayload.WirelogErrorsubclass in the module has its own non-trivial docstring.Unit 2 —
8b9c152— enrichdocs/reference/errors.mdwirelog_error_tcode→exception mapping table, a "PyreWire-only errors (not produced bycheck())" section, an exception-handling example (public imports), and:::directives forcheck()/error_string().Accuracy
raised whendescriptions cross-referenced against bundled wirelog 0.51.0 (0c6e0cd) and the real raise sites. The consensus audit corrected three docstring-accuracy defects before merge:WirelogVersionError— described the wrong same-named class; corrected to the capability/symbol gate atprogram.py:163.WirelogModeError— "insert batch" → session-level mode exclusivity (step/snapshot/query).WirelogIOError— "viacheck()" → direct raise viaio_adapter.py.Verification
flake8/black/isortclean;errors.pymypy cleanpytest: errors 27/27, full suite 91.24% coveragemkdocs build --strict: passes (0 errors)Follow-ups (non-blocking, out of scope)
WirelogInternErrordocstring documents reverse-intern lookup only, butintern.py:46also raises on forward-intern failure (pre-existing).WirelogVersionError(_core/errors.pyvs_ffi/_loader.py) — consider consolidating.