Summary
Having explored the various hooks available in SvelteKit as well as error handling, we’ve covered a lot. We first saw how we can modify outgoing fetch()
requests that leverage SvelteKit’s included fetch()
by changing familiar RequestEvent
objects in the handleFetch()
hook. We also saw how we can adjust data flowing into our application via handle()
. Then, we explored the handleError()
shared hook and how it can be utilized to build a rich logging mechanism or incorporated with another service. Finally, we returned to look at how we can manage expected errors with SvelteKit’s error routing devices, which allow us to customize the look and feel through custom Svelte components.
Now that we have a firm grasp on how to manage errors, we’ll move on to the next chapter to assess how we can best manage static assets.