error-handling

Official

Errors as values, not exceptions. Rest easy.

Authorsite-bender
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill eliminates the unpredictability and complexity of traditional exception handling by treating all errors as explicit values. It ensures robust, predictable error management, reducing runtime crashes and simplifying debugging, so your applications are more reliable.

Core Features & Use Cases

  • Result & Validation Monads: Standardizes error representation using Result<T,E> for single failures and Validation<T,E> for collecting multiple errors.
  • Discriminated Unions for Error Types: Guides the design of clear, type-safe error structures, making error identification and handling explicit.
  • Automated Error Type Generation: Provides a script to scaffold new error types, including constructors and type guards.
  • Use Case: When building an API endpoint, use this skill to define a UserCreationError as a discriminated union. Then, wrap all fallible operations (e.g., database writes, external API calls) in Result monads, ensuring that your function always returns a predictable Ok or Error value, never throwing an unexpected exception.

Quick Start

Generate a new error type named 'NetworkError' with variants 'Timeout' and 'Disconnected'.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: error-handling
Download link: https://github.com/site-bender/sitebender/archive/main.zip#error-handling

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.