error-handling

Enforce standardized error handling with neverthrow patterns across applications.

23|3|Updated Jun 28, 2022
One-click install
npx skills add https://github.com/Esposter/Esposter --skill error-handling-esposter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/Esposter/Esposter/tree/main/.agents/skills/error-handling
Command: npx skills add https://github.com/Esposter/Esposter --skill error-handling-esposter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Esposter's error handling conventions use neverthrow patterns to replace try/catch, ensure explicit error propagation, consistent logging, and user-friendly failure modes across UI and server boundaries.

Core Features & Use Cases

  • Never write try/catch anywhere; adopt getResult/getResultAsync for all operations.
  • Use withFinalizer/withFinalizerAsync for safe cleanup and finalization in both sync and async flows.
  • Enforce deterministic error handling with .match/.unwrap and centralized logging or user alerts across components, composables, stores, and tRPC routers.
  • Apply tRPC backend guards to enforce consistent error handling and guard against invalid state.

Quick Start

Replace try/catch blocks with getResult/getResultAsync and add finalizers to enforce consistent error flow.

Frequently Asked Questions about error-handling

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

FAQPage Schema
How do I enforce consistent error handling in tRPC routers without try/catch?▼

To enforce consistent error handling in tRPC routers without try/catch, apply neverthrow patterns using getResult/getResultAsync for operations and deterministic .match/.unwrap patterns to propagate, log, or surface errors.

What is the best way to handle errors in TypeScript composables and stores?▼

The best way to handle errors in TypeScript composables and stores is replacing try/catch with neverthrow patterns, using getResult/getResultAsync and withFinalizer/withFinalizerAsync to ensure explicit error propagation and safe cleanup.

How do I add safe cleanup and finalization to async error flows in TypeScript?▼

To add safe cleanup and finalization to async error flows in TypeScript, use withFinalizer/withFinalizerAsync alongside getResult/getResultAsync, ensuring deterministic error handling and safe resource finalization across sync and async boundaries.

Does neverthrow work with tRPC backend guards to prevent invalid state?▼

Yes, neverthrow works with tRPC backend guards to prevent invalid state by enforcing consistent error handling flows, replacing try/catch, and applying standardized finalization and error propagation patterns across server routes.

Why should I replace try/catch with getResult for TypeScript error handling?▼

You should replace try/catch with getResult for TypeScript error handling to enforce explicit error propagation, ensure consistent logging, provide user-friendly failure modes across UI and server boundaries, and maintain deterministic error flows.

How do I surface user-friendly failure modes from tRPC operations?▼

To surface user-friendly failure modes from tRPC operations, apply neverthrow patterns with .match/.unwrap to deterministically handle errors, enforce centralized logging, and propagate failures safely without using try/catch.