Recall & Review
beginner
What is the purpose of the +error.svelte file in a SvelteKit project?
The +error.svelte file defines a custom error page that shows when a route fails or an error occurs. It helps display friendly messages instead of default browser errors.
Click to reveal answer
beginner
How do you access the error details inside +error.svelte?
You receive an
error and status prop automatically. Use these to show the error message and HTTP status code on the page.Click to reveal answer
intermediate
What HTTP status codes can trigger the +error.svelte page in SvelteKit?
Any HTTP error status like 404 (Not Found), 500 (Server Error), or custom errors can trigger the +error.svelte page to display.
Click to reveal answer
beginner
Can you customize the look and content of the +error.svelte page?
Yes! You can style it with CSS and add any HTML or Svelte code to make the error page user-friendly and match your app's design.
Click to reveal answer
beginner
What happens if you don't create a +error.svelte file in your SvelteKit app?
SvelteKit shows a default plain error page with minimal info. Creating +error.svelte lets you provide a better user experience.
Click to reveal answer
What props does +error.svelte receive automatically?
✗ Incorrect
The +error.svelte component automatically receives 'error' and 'status' props to display error details.
Which file name triggers a custom error page in SvelteKit?
✗ Incorrect
The special file '+error.svelte' is used by SvelteKit to show custom error pages.
If a route returns a 404 error, what happens in SvelteKit if +error.svelte exists?
✗ Incorrect
SvelteKit shows the +error.svelte page with the 404 status and error message.
Can you add custom styles to +error.svelte?
✗ Incorrect
You can add CSS or scoped styles inside +error.svelte just like any other Svelte component.
What is the default behavior if +error.svelte is missing?
✗ Incorrect
Without +error.svelte, SvelteKit shows a basic default error page with minimal info.
Explain how +error.svelte works in SvelteKit and how you can use it to improve user experience.
Think about what happens when a page fails to load and how you want to show that to users.
You got /5 concepts.
Describe the steps to create a custom error page using +error.svelte in a SvelteKit app.
Focus on file creation, props usage, and testing.
You got /5 concepts.