errore

Return typed errors as values in TypeScript with pattern matching and resource cleanup.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/otography/otography-app --skill errore-otography
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: errore
Source: https://github.com/otography/otography-app/tree/main/.agents/skills/errore
Command: npx skills add https://github.com/otography/otography-app --skill errore-otography

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

errore provides Go-style error handling for TypeScript by returning typed errors as values (Error | T) rather than throwing.

Core Features & Use Cases

  • Create typed errors with interpolation using createTaggedError.
  • Pattern match and route errors with matchError and findCause, enabling exhaustive handling and rich error context.
  • Seamless async/sync boundary handling with try, unwrap, and disposable stacks for resource cleanup.

Quick Start

Use the errore skill to learn how to represent errors as values and implement Go-style error handling in TypeScript.

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 instead of throwing?

To handle errors as values in TypeScript, you return typed unions (Error | T) rather than throwing exceptions. This Go-style approach provides predictable, exhaustive error handling across both synchronous and asynchronous code without relying on wrapper types.

What is the best way to pattern match tagged errors in TypeScript?

The best way to pattern match tagged errors is using a matchError function to route and identify specific error types. This enables exhaustive handling and allows you to find causes with rich error context, replacing fragile string checks with structured matching.

How do I create typed domain errors with interpolation in TypeScript?

You create typed domain errors with interpolation using a createTaggedError utility. This allows you to define specific error types and inject dynamic context data directly into the error structure, ensuring strongly typed domain-specific failures.

Does Go-style error handling without wrapper types work with async TypeScript code?

Yes, Go-style error handling works seamlessly with async TypeScript code. It uses try and unwrap functions to bridge sync and async boundaries, while utilizing disposable stacks to guarantee safe resource cleanup during execution.

Why should I return typed unions instead of throwing exceptions in TypeScript?

Returning typed unions instead of throwing exceptions makes error handling predictable and exhaustive. By treating errors as values, you eliminate uncaught exceptions and force the compiler to verify all potential error paths are handled safely.