What problem does it solve? Python codebases often suffer from inconsistent error handling: bare except clauses, lost exception context, unmanaged resources, and unstructured logs that make production failures hard to diagnose. This Skill provides idiomatic patterns for building a coherent error handling strategy. ## Core Features & Use Cases - Custom Exception Hierarchies: Define a package-level base exception with derived types like ValidationError, ConfigurationError, and APIError for precise error classification. - Exception Chaining & Context Managers: Preserve original tracebacks with raise X from e, suppress noise with from None, and guarantee resource cleanup via @contextmanager decorators. - Structured Logging & Resilience Patterns: Configure structlog or stdlib logging with contextual fields, implement retry-with-backoff decorators for transient failures, and use a Result type (Ok/Err) for explicit error returns. - Use Case: When building a payment processing service, use this Skill to wrap external API failures in a custom APIError with chained context, log failures with structured order metadata, and retry transient errors with exponential backoff. ## Quick Start Review my Python service's error handling and refactor it to use a custom exception hierarchy with chained exceptions, structured logging, and retry logic for transient failures.