← ClaudeAtlas

exception-cataloglisted

Use when adding an error class or reusing one, or translating an SDK or library exception at a boundary. Owns the single catalog file, its root and bare subclasses, the stable codes, the inherited `context` dict, translation with `from exc`, the ban on swallowing a failure, best-effort compensation as the one case a scope that re-raises stops a second failure, and a failure after a committed write, which is stopped rather than re-raised. The status a transport answers with is mapped at that transport's boundary, never carried by the class; where the error is logged is `python-logging`.
wntic/pyhouse · ★ 3 · Code & Development · score 76
Install: claude install-skill wntic/pyhouse
# Exception Catalog Every project in this style has **exactly one file** where its own exceptions are defined. It holds a root error plus one bare subclass per named error, so the catalog stays auditable in a single read and nothing raises a type that was invented at the call site. Where that file sits is the only thing that varies, and one obligation settles it for any project shape: **one catalog module, at a place every part of the codebase may import from without creating a cycle, named for what it holds.** The catalog imports nothing of the project's own, so anything may import it; put it wherever the project's own import direction makes that true. It is a module, `exceptions.py` — never `exceptions/__init__.py`, because an `__init__.py` holds only imports and `__all__` (`python-packaging`); `from myapp.exceptions import …` reads the same either way. The root class is named for the project, and every other class in the file descends from it. Where an architecture family fixes that place — `hex-architecture`, in the `pyhouse-hex` plugin, or `flat-layered`, in the `pyhouse-flat` plugin — follow it; otherwise the obligation decides: a framework-shaped tree puts the module where every one of the framework's units already imports from, a distributable package puts it at its own root because the classes its callers catch are part of the published surface, and a command-line tool puts it above the command modules that raise from it. One file either way — the reason for a sin