error-handling
OfficialErrors as values, not exceptions. Rest easy.
Software Engineering#type safety#typescript#error handling#functional programming#error types#validation monad#result monad
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 andValidation<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
UserCreationErroras a discriminated union. Then, wrap all fallible operations (e.g., database writes, external API calls) inResultmonads, ensuring that your function always returns a predictableOkorErrorvalue, never throwing an unexpected exception.
Quick Start
Generate a new error type named 'NetworkError' with variants 'Timeout' and 'Disconnected'.
Dependency Matrix
Required Modules
None requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.