The documentation seems a bit vague about showing the error page from Hooks. I am looking for a way to show the 404 page conditionally.
export async function handle({ event, resolve }) {
return new Response('This page does not exist.', {status: 404})
}
This returns a status 404 page in a plain text, but I want it to return an error page with a layout, not just text. Is there any API to use? Or should I redirect to the 404 page?