인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
디자인 및 창작 · SKILL.md

python-error-handling

python-error-handling

Design Python error paths with narrow exceptions, rollback, contextual logs, and preserved blocker truth. Use when handling retries, verifier outcomes, parser failures, or exception flow in Python services.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: python-error-handling description: Design Python error paths with narrow exceptions, rollback, contextual logs, and preserved blocker truth. Use when handling retries, verifier outcomes, parser failures, or exception flow in Python services. metadata: triggers: files: - "**/*.py" keywords: - except - exception - retry - rollback - blocker - error handling

Python Error Handling

Priority: P1 (HIGH)

Rules

  • Catch the narrowest exception you can explain.
  • Roll back mutable state before re-raising or returning failure status.
  • Add context to logs and raised errors without discarding the root cause.
  • Preserve blocker truth; do not convert real failure into vague success text.

Recipe

  1. Handle expected failures close to the boundary.
  2. Re-raise unexpected failures after cleanup.
  3. Return structured blocker or verdict data when the caller needs workflow truth.
  4. Test timeout, malformed input, and missing-env paths.

Anti-Patterns

  • No silent except Exception: pass.
  • No broad catch that marks work complete without evidence.
  • No duplicate logging at every stack layer.
  • No blocker text without owner or next action when the protocol needs both.

References

저장한 Skills