zedkit
@zedtech/zedkit-core

Handle errors without try/catch

@zedtech/zedkit-core — beta

beta

At a glance

  • Who: TypeScript developers wrapping throwing calls (JSON, IO, third-party SDKs).
  • What: Turn any throwing call into a typed Result without a try/catch block.
  • Use when: At the boundary with throwing code you do not control.
  • Avoid when: Inside code that already returns Results — compose with mapResult instead.
  • See also: Model success or failure without throwing

Install

pnpm add @zedtech/zedkit-core

Latest: 0.1.2 (via changesets).

Example

Usage
import { tryCatch } from "@zedtech/zedkit-core";
const parsed = tryCatch(() => JSON.parse(input));
if (!parsed.ok) return fallback(parsed.error);

Wraps: (none)

On this page