Library Subclass Explicit Type Classification

Use when classifying exceptions or other library-provided objects by type AND the semantically-distinct behaviors map onto a class-hierarchy where subclasses inherit from a base with DIFFERENT desired handling. Common in retry-logic for HTTP clients (requests/httpx — Timeout vs HTTPError vs ConnectionError), Telegram bots (BadRequest inherits from NetworkError but should NOT be treated as network), SQL clients (OperationalError vs ProgrammingError), file IO (FileNotFoundError vs PermissionError vs OSError). Trigger on phrases like "retry logic for TelegramError", "isinstance vs type()", "exception type check", "subclass trap", "HTTPError vs Timeout". Produces class-hierarchy mapping via `mro()`, explicit type-classification helper, and tests locking the distinction. Do NOT load when all hierarchy exceptions should be handled identically, when docs explicitly state "always catch base class", or for first-time exception-handling design.

Ed3Design 260e3bf 7.3 KB Updated

File contents

Ed3Design/ed3design-skill-bundles/tree/main/code-quality/skills/library-subclass-explicit-type-classification commit 260e3bf6f5

Frequently asked questions

npx skillmds@latest add ed3design/library-subclass-explicit-type-classification