skills sourced live from GitHub · all skills listed are free · each skill is provided under its author's license.
home / Coding / Python Error Handling Skill by @wshobson
The skill is the plugins/python-development/skills/python-error-handling folder inside that repository. Copy it into the folder your agent loads skills from; check your agent's documentation for where that is.
Patterns for Python failure handling: fail-fast validation, clear exception hierarchies and graceful partial failure in batch jobs.
Four principles organise it: fail fast, raise meaningful exceptions, tolerate partial failures and preserve context when re-raising. Useful for services that process lists of items where one bad record should not sink the batch.
The original SKILL.md is organised into these sections:
Written and maintained by @wshobson. It is published under the MIT license, which allows reuse with attribution. See the author profile. SkillDirectory does not claim authorship: this page adds our own review and links back to the original, and the skill's text belongs to its author.
# Python Error Handling Build robust Python applications with proper input validation, meaningful exceptions, and graceful failure handling. Good error handling makes debugging easier and systems more reliable. ## When to Use This Skill - Validating user input and API parameters - Designing exception hierarchies for applications - Handling partial failures in batch operations - Converting external data to domain types - Building user-friendly error messages - Implementing fail-fast validation patterns ## Core Concepts ### 1. Fail Fast Validate inputs early, before expensive operations. Report all validation errors at once when possible. ### 2. Meaningful Exceptions Use appropriate exception types with context. Messages should explain what failed, why, and how to fix it. ### 3. Partial Failures In batch operations, don't let one failure abort everything. Track successes and failures separately. ### 4. Preserve Context …
Excerpt only, quoted from the author's repository. Open the repository for the complete file.