clean-code-ch07-error-handling

Audit exception usage and error-handling structure across Java, Python, and C# codebases.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch07-error-handling
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clean-code-ch07-error-handling
Source: https://github.com/hatlesswizard/clean-code-skills/tree/main/ch07-error-handling
Command: npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch07-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code quality checker based on Clean Code Ch7: Error Handling — checks exception vs error codes, try-catch structure, exception context, caller-oriented exceptions, Special Case pattern, null return/pass prevention

Core Features & Use Cases

  • Detect misuses of exceptions, poor error context, and tangled error handling in code.
  • Enforce best practices like using unchecked exceptions, avoiding null returns, and wrapping third-party APIs.
  • Use during code reviews, CI checks, and automated analyzers to elevate error handling quality.

Quick Start

Run the checker on your codebase to flag error-handling anti-patterns and guide refactoring.

Frequently Asked Questions about clean-code-ch07-error-handling

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

FAQPage Schema
How do I detect bad exception handling patterns in my codebase?▼

Detect bad exception handling by auditing exception usage, try-catch structure, and context. This checker flags misuses like poor error context, tangled nested blocks, and return code anti-patterns during code reviews or CI checks, guiding refactoring for robust error handling.

What is the best way to separate error handling from business logic?▼

Separate error handling from business logic by enforcing clean practices like the Special Case pattern and wrapping third-party APIs. This approach untangles nested try-catch blocks and ensures your main code flow remains readable and focused on core functionality.

Does this error handling checker work with Python and Java code?▼

Yes, this error handling checker works with Python, Java, C#, and other languages. It audits your codebase to enforce clean error-handling practices regardless of the specific language, checking for misuse of return codes, nulls, and exception context.

Why should I use unchecked exceptions instead of error codes?▼

Use unchecked exceptions instead of error codes to improve code quality and robustness. This checker enforces guidelines by promoting unchecked exceptions and caller-oriented messages, ensuring errors are contextualized rather than hidden within misleading return values.

How do I prevent null returns and passes in my codebase?▼

Prevent null returns and passes by auditing your codebase for null safety anti-patterns. This checker enforces best practices by flagging null returns and promoting alternatives like the Special Case pattern, ensuring robust error handling and eliminating null-related runtime errors.