error-handling

Standardize exception hierarchies, propagation rules, and retry semantics in code.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/sage-base/sagebase --skill error-handling-sage-base
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/sage-base/sagebase/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/sage-base/sagebase --skill error-handling-sage-base

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Sagebaseのエラーハンドリングの一貫性不足を解消し、例外階層と伝播ルールを標準化します。

Core Features & Use Cases

  • 例外階層の設計: Domain層・Infrastructure層・Application層で整合性のある例外を定義します。
  • 伝播と再試行: 失敗時の伝播ルールと再試行可能エラーの取り扱いを統一します。
  • コード品質の向上: すべてのエラー処理に対して from e を使用し、デバッグ情報を保持します。
  • Use Case: 新しい外部サービスの統合時に適切な例外を投げ、再試行を計画します。

Quick Start

Activate guidelines by adding domain exceptions, updating except blocks to avoid broad catches, and documenting retryable errors.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I standardize exception hierarchies across application layers?

To standardize exception hierarchies across application layers, define explicit exception classes for the Domain, Infrastructure, and Application layers. This ensures consistent error propagation rules and maintains logical separation between different architectural boundaries.

What is the best way to handle retryable errors for external service integrations?

The best way to handle retryable errors for external service integrations is to explicitly document the distinction between retryable and non-retryable exceptions. This allows you to implement targeted retry semantics for transient failures without masking permanent issues.

Why does proper error chaining with from e matter during code reviews?

Proper error chaining with from e matters during code reviews because it preserves the original traceback and debug context when re-raising exceptions. This prevents information loss and significantly reduces the time needed to diagnose root causes in complex I/O or LLM integrations.

How do I avoid broad exception catches when integrating new external services?

To avoid broad exception catches when integrating new external services, define and raise explicit exception classes tailored to the specific failure modes of the service. Update except blocks to catch these specific types rather than using generic exception handlers.

When do I need explicit exception classes for LLM integrations?

You need explicit exception classes for LLM integrations when you must distinguish between transient network failures and permanent model invocation errors. This distinction enables standardized retry semantics and robust error handling for external service dependencies.

What are the limitations of using generic exceptions for I/O operations?

Using generic exceptions for I/O operations limits your ability to implement targeted retry logic and obscures the root cause of failures. Without explicit exception types, you cannot effectively distinguish between retryable transient errors and permanent infrastructure failures.