What problem does it solve?
Prevents confusing, unsafe failure states by turning unpredictable runtime errors into consistent, user-safe responses with complete logs for developers.
Core Features & Use Cases
- First-class error handling: catch specific errors, never swallow them, and avoid exposing stack traces, internal paths, or secrets.
- Typed custom error hierarchy: use
AppError plus domain-specific errors (e.g., ValidationError, NotFoundError, AuthError) with predictable code and statusCode.
- Boundary validation with Zod: validate external inputs using
safeParse, fail fast, and infer types from schemas for correctness.
- Supabase failure mapping: check
.error before using .data and translate common Supabase error codes into the right error types.
- React route-level error boundaries: implement
ErrorBoundary to show friendly UI while logging detailed component stacks.
- Consistent API error responses: return a stable
{ type, message, errors? } shape without leaking sensitive details.
Quick Start
Ask the AI: implement typed Zod boundary validation, map Supabase .error codes to custom AppError subclasses, and wire a React ErrorBoundary with a consistent API error response format.