# error-boundaries Definition
**Definition:** Add `+error.svelte` to render a custom error page for
errors thrown during `load`/rendering in the corresponding route
subtree.
**Syntax:** `src/routes/+error.svelte`, or nested
`.../route/+error.svelte`
**Notes:**
- SvelteKit walks up to the nearest `+error.svelte` if a child doesn’t
exist.
- Errors in `+server` handlers and `handle` do not use
`+error.svelte`; they return JSON or fallback error page.
- For 404s with no matched route, root `+error.svelte` is used.
## Example
```svelte
<script lang="ts">
import { page } from '$app/state';
</script>
<h1>{page.status}: {page.error.message}</h1>
```
## Related
- `advanced-routing`, `hooks.server.handleError`
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/spences10/mcp-svelte-docs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server