You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(exceptions): an exception class declares its error_code and exit_code, and the forwarding __init__ methods, unused classes and CONST_ERROR_CODE constants go #2490
Part 2 of #1006. The exception package (src/devops_cli/exceptions/, 96 classes, checked at origin/main 08d70ca, 2026-10-28) states each error code three ways, and most of its code only repeats the base class:
32 classes have an __init__ whose only statement is super().__init__(...).
46 CONST_ERROR_CODE_* constants in src/devops_cli/config/constants.py. Their only importers are the exception modules and ai/rag/embeddings.py.
Some classes are never raised in src. The change lists them with the search that shows no raise and no except.
Proposed Solution & Architectural Design
DevOpsCLIError reads error_code and exit_code from class attributes. Each class declares its own. Domain bases add only their structured-detail keys.
The __init__ methods that only forward to the base are deleted.
Classes that no code raises, catches or re-exports are deleted.
The CONST_ERROR_CODE_* constants become class data, and config/constants.py keeps none of them.
tests/test_exceptions.py checks a table built from the class hierarchy: one error code maps to one exit status.
docs/ERRORS.md is regenerated and lists the same codes and exit statuses as before.
The documents that name CONST_ERROR_CODE_* say that an exception class declares its error_code and exit_code.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change restructures exception class declarations without altering user-facing behaviour.It simplifies 96 classes and removes dead code, improving maintainability but not fixing a user-facing defect.It reduces code duplication and makes the exception hierarchy self-documenting for developers.It touches 96 classes, a constants file, tests and docs, but the edits are mechanical.Both are parts of #1006 working on the exception package, but 2487 fixes the exit seam mechanism while this item refactors how classes declare their codes.fix(cli): every command reports a DevOpsCLIError through one exit seam (