errore

Return errors as values in TypeScript with tagged errors and utilities.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/otto-assistant/bridge --skill errore-otto-assistant
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: errore
Source: https://github.com/otto-assistant/bridge/tree/main/cli/skills/errore
Command: npx skills add https://github.com/otto-assistant/bridge --skill errore-otto-assistant

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go-style error handling for TypeScript: return errors as values instead of throwing. Functions return an Error | T union, and checks use instanceof Error to narrow types, enabling flat control flow and explicit error handling. The errore toolkit provides helpers like createTaggedError, matchError, findCause, and partition to compose robust, typed error strategies without heavy wrappers or monads.

Core Features & Use Cases

  • Return errors as values (Error | T) to make failures explicit and type-safe.
  • Tagged errors with cause chains, static type guards, and utilities (matchError, findCause, partition).
  • Clear boundary handling for async boundaries and third-party libraries; enables predictable error propagation.

Quick Start

Install the errore library and adopt Go-style error handling by returning errors as values in your TS code.

Frequently Asked Questions about errore

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

FAQPage Schema
How do I handle TypeScript errors as values instead of throwing exceptions?

To handle TypeScript errors as values, you return an Error | T union from functions and use instanceof Error to narrow types, enabling flat control flow and explicit error handling without try-catch blocks.

What is the best way to implement typed error handling in TypeScript for API clients?

The best way to implement typed error handling in TypeScript is using Go-style returns where functions return Error | T, applying tagged errors with cause chains to ensure predictable, type-safe failure propagation in API clients.

Can I trace error cause chains in TypeScript without using heavy monads?

Yes, you can trace error cause chains in TypeScript without heavy monads by creating tagged errors and using utilities like findCause and matchError to compose robust, typed error strategies cleanly.

How do I adapt third-party library throws into predictable TypeScript errors?

You adapt third-party library throws into predictable TypeScript errors by using boundary adapters at async boundaries, catching exceptions and returning them as explicit Error | T values for safe control flow.

Does Go-style error handling in TypeScript require any external dependencies?

No, adopting Go-style error handling in TypeScript does not require external dependencies, as the errore toolkit operates with zero dependencies to provide typed error utilities like partition and matchError.

How do I separate successful results from errors in a TypeScript data-fetching array?

To separate successful results from errors in TypeScript data-fetching code, you use the partition utility to split an array of Error | T outcomes into distinct errors and successes for clean processing.