errore

Implement type-safe error handling with tagged errors and exhaustive matching in TypeScript.

14|1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/code-xhyun/disunday --skill errore-code-xhyun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: errore
Source: https://github.com/code-xhyun/disunday/tree/main/errore
Command: npx skills add https://github.com/code-xhyun/disunday --skill errore-code-xhyun

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a robust, type-safe way to handle errors in TypeScript, eliminating the need for traditional try-catch blocks and promoting a more predictable and maintainable codebase.

Core Features & Use Cases

  • Errors as Values: Functions return Error | Value unions, making error handling explicit and compile-time checked.
  • Tagged Errors: Define custom, strongly-typed errors with interpolated messages and properties.
  • Exhaustive Matching: Use matchError for compile-time guaranteed handling of all possible error states.
  • Use Case: When building an API, ensure that every potential error (e.g., NotFoundError, ValidationError, DatabaseError) is explicitly handled by the caller, preventing runtime crashes and improving reliability.

Quick Start

Use the errore skill to define a NotFoundError class and handle it when fetching a user.

Frequently Asked Questions about errore

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

FAQPage Schema
How do I handle errors as values in TypeScript without using try-catch blocks?

Handling errors as values in TypeScript involves returning Error | Value unions instead of throwing exceptions. This makes error handling explicit and compile-time checked, improving code predictability and eliminating hidden runtime crashes.

What is the best way to ensure exhaustive matching of custom errors in TypeScript?

Exhaustive matching of custom errors in TypeScript uses a matchError function to guarantee compile-time handling of all possible error states. By defining tagged errors, developers can explicitly address every specific error type before execution.

How do I create strongly-typed custom errors with interpolated messages in TypeScript?

Creating strongly-typed custom errors in TypeScript uses tagged error classes that support interpolated messages and properties. This approach leverages the type system to attach contextual data to errors, ensuring robust compile-time safety.

Does this error-as-value approach work for building reliable TypeScript APIs?

The error-as-value approach works effectively for building TypeScript APIs by ensuring that potential errors like NotFoundError or ValidationError are explicitly handled by the caller. This prevents unhandled runtime exceptions and improves overall API reliability.

When should I replace traditional try-catch error handling with a Result type pattern?

You should replace try-catch error handling with a Result type pattern when you need type-safe, predictable error management. This pattern forces explicit error extraction and transformation at compile-time, eliminating unpredictable control flow.