Error handling (expected/unexpected/form/API)
Generated from
mcp/patterns.registry.json— do not edit by hand; change the registry and runbun run patterns:build.
Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.
Category: Architecture & Request Pipeline · Tier: light · Risk: low — structural pattern, no external services
Classifies errors into expected, unexpected, form, and API categories, each handled by a distinct SvelteKit mechanism (error(), handleError, fail(), json()).
When to use: Reach for it when deciding how to surface a failure from a load function, form action, or API endpoint.
Docs
Code
Proof
Machine-readable record: architecture-error-handling in mcp/patterns.registry.json.