Svelte & SvelteKit (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
SvelteKit Error Handling: Expected vs Unexpected Errors.
senior LevelSystem DesignSvelte 5
In Simple Words:
- Expected Errors: Thrown using
error(status, message)from@sveltejs/kit. Displays the nearest+error.svelteboundary with a user-friendly message. - Unexpected Errors: Uncaught exceptions (e.g. database crashes). SvelteKit automatically sanitizes the error message to avoid leaking stack traces or credentials, logging the real error internally on the server.