Error Handling Patterns

Master error handling patterns across languages including exceptions, Result types, error…

A cross-language playbook for building resilient applications that fail safely instead of crashing silently. It covers exception hierarchies, Result/Option types, retry with backoff, circuit breakers and graceful degradation across Python, TypeScript, Rust and Go, turning ad-hoc try-catch blocks into a deliberate reliability strategy.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category Development
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, error-handling-patterns

Inside the run · no black box

See the actual work before you buy it.

The skill treats every failure as a designed path, not an accident. The loop it runs when wiring error handling into a system:

  1. Categorizes each possible failure by blast radius first: ValidationError touches one request, DatabaseError touches all writes, ExternalServiceError touches one integration. Each category gets its own recovery strategy before any code is written.
  2. Builds a typed error hierarchy (AppError base, then ValidationError 400, AuthError 401, NotFoundError 404, ConflictError 409, InternalError 500), each carrying an error code, HTTP status and a user-facing message.
  3. Applies fail-fast at the boundary: input validation at the very top of the handler so invalid data never reaches business logic. Expected failures return Result types; exceptions are reserved for the truly unexpected.
  4. Routes transient failures (network timeout, 503) to retry with exponential backoff, and chronic failures to a circuit breaker: 5 consecutive fails opens the circuit for 60 seconds, a half-open probe tests recovery, fallback responses serve meanwhile.
  5. Designs graceful degradation per dependency: payment down means queue the order and tell the user it is processing, search timeout means serve cached results, image service down means placeholder. Silent quality drops are forbidden.
  6. Logs every error structured (timestamp, request ID, user ID, error code, stack, context) and never swallows one: empty catch blocks are the cardinal sin. Error budget tracking (99.9% SLO equals 43 minutes per month) decides when feature work stops for stability work.
Use cases · what happens when you plug it in

One power source. 6 lines out.

error-handling-patterns · core

core active · 6 lines

  1. Designing a typed error hierarchy (Validation, NotFound, ExternalService) with HTTP status mapping

    ✓ designing a typed error
  2. Adding retry with exponential backoff for flaky network and external-API calls

    ✓ adding retry with expone…
  3. Wrapping a payment or email integration in a circuit breaker to stop cascading failures

    ✓ wrapping a payment or em…
  4. Returning explicit Result types instead of throwing for expected validation failures

    ✓ returning explicit result
  5. Aggregating multiple validation errors instead of failing on the first one

    ✓ aggregating multiple val…
  6. Building graceful fallbacks (cache then database, primary then secondary provider)

    ✓ building graceful fallba…
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. Replace silent failures with actionable user messages and proper monitoring alerts

    license: perpetual
  2. Contain the blast radius of any single fault so one integration outage doesn't take down everything

    license: perpetual
  3. Spend less time debugging production by preserving context, timestamps and structured logs

    license: perpetual
  4. Distinguish transient errors (retry) from permanent ones (fail fast) to avoid wasting resources

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

Custom exception hierarchy examples in Python and TypeScript with error codes and details

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

Backend and full-stack engineers building APIs and distributed systems who want fault tolerance that is designed in, not bolted on after an outage.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. My stack is only TypeScript, is the cross-language coverage wasted on me?

    No, each pattern is shown per language, so you use the TypeScript implementations directly and ignore the rest. The cross-language framing only matters if you run a polyglot backend.

  2. Won't retries and circuit breakers just add complexity I don't actually need?

    Each pattern targets a specific failure mode, so you add a circuit breaker around a flaky payment call, not around everything. Applied where the failure actually happens, they remove cascading outages rather than adding noise.

  3. Does this replace a resilience library or my monitoring?

    No, it is design patterns and typed-error structure, not a packaged library or an observability tool. It tells you what to build and where, you still wire in your own libraries and monitoring.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.