🚧 Alpha Version - Not Production Ready

Type-Safe Error Handling
Made Simple

Lightweight, progressive, type-safe error handling for TypeScript. Bridge the gap between try/catch and heavy functional programming with zero-overhead success paths.

Zero Overhead

Success values are returned directly with no wrapping. Error objects only created when needed.

// Success: Direct return
const result = trySync(() => parse(data));
// result is ParsedData | TryError

Progressive Adoption

Start simple with basic error handling, add complexity as needed. No need to rewrite existing code.

// Start simple
const result = trySync(() => operation());
// Add retry, timeout, etc. later
🛡️

TypeScript First

Full type inference, discriminated unions, and strict null checks. Built for TypeScript developers.

if (isTryError(result)) {
  // result is TryError
} else {
  // result is success type
}

See It In Action

❌ Before: Traditional try/catch

try {
  const response = await fetch("/api/user");
  const user = await response.json();
  return user;
} catch (error) {
  console.error("Something failed:", error);
  return null;
}

✅ After: try-error

const result = await tryAsync(async () => {
  const response = await fetch("/api/user");
  return response.json();
});

if (isTryError(result)) {
  console.error("API failed:", result.message);
  return null;
}

return result; // Type-safe success value

Quick Links