zedkit
@zedtech/zedkit-core

Classify failures for retry policy

Typed error kinds plus `classifyError` so workers and HTTP layers pick the same policy.

beta

At a glance

  • Who: Service authors who route failures to retry, dead-letter, or client-facing errors.
  • What: Typed error kinds plus classifyError so workers and HTTP layers pick the same policy.
  • Use when: At domain boundaries and queue consumers where retry vs fail-fast must be explicit.
  • Avoid when: For validation-only failures — return a Result or map to 400 without throwing.

Install

pnpm add @zedtech/zedkit-core

Latest: 0.1.3 (via changesets).

Example

Usage
import { classifyError, DomainError, TransientError } from "@zedtech/zedkit-core";
if (classifyError(err) === "transient") await retryLater();
throw new DomainError("slot_taken", "Slot already booked");
throw new TransientError("upstream timeout", { cause: err });

Wraps: (none)

On this page