handling-errors

Enforce exception visibility through logging or re-raising in FormalTask code.

13|1|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/davidabeyer/formaltask --skill handling-errors-davidabeyer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: handling-errors
Source: https://github.com/davidabeyer/formaltask/tree/main/skills/handling-errors
Command: npx skills add https://github.com/davidabeyer/formaltask --skill handling-errors-davidabeyer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical issue of silent failures in code by enforcing visibility for all exception handlers, preventing bugs from being hidden and leading to more robust software.

Core Features & Use Cases

  • Enforces Visibility: Ensures every exception handler either logs the error or re-raises it, eliminating except: pass anti-patterns.
  • Defines Exception Levels: Provides clear guidance on when to use ERROR, WARNING, and DEBUG log levels for exceptions.
  • Provides Patterns & Anti-Patterns: Illustrates correct and incorrect ways to handle exceptions in various contexts like database operations, file handling, and API calls.
  • Use Case: When debugging an intermittent issue, this Skill helps you identify if a silent exception is the root cause and guides you on how to add proper logging or re-raising to make the error visible.

Quick Start

Ensure all exception handlers in the codebase log or re-raise errors.

Frequently Asked Questions about handling-errors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop silent failures in Python exception handlers?

To stop silent failures in Python exception handlers, you must ensure every except block either logs the error or re-raises the exception, eliminating empty except blocks to guarantee full visibility for all exceptions.

What is the difference between ERROR, WARNING, and DEBUG log levels for exceptions?

The difference between ERROR, WARNING, and DEBUG log levels for exceptions lies in severity: ERROR indicates critical failures requiring attention, WARNING highlights recoverable issues, and DEBUG captures diagnostic details for tracing intermittent bugs during development.

How do I handle exceptions during database operations and API calls?

To handle exceptions during database operations and API calls, apply specific error handling patterns that mandate logging or re-raising, ensuring that domain-specific exceptions are caught and processed rather than being silently ignored.

Why does my code have intermittent bugs that are hard to trace?

Intermittent bugs that are hard to trace are often caused by silent failures where exception handlers hide errors without logging. Implementing robust error handling by mandating visibility for all exceptions helps identify if a hidden error is the root cause.

What are the anti-patterns for file handling exceptions in Python?

Anti-patterns for file handling exceptions in Python include using empty except blocks that swallow errors. Correct patterns enforce visibility by mandating that file operation errors are either logged with appropriate levels or re-raised immediately.