Files
homepage/src/routes/[faithLang=faithLang]/[...rest]/+page.server.ts
T
Alexander ad154bf914 fix(errors): surface Bible verses on section error pages
SvelteKit's handleError hook is skipped for expected `error()` throws,
so verses set there never reached `$page.error` for server-thrown 404s
and auth denials. Introduce `errorWithVerse()` in `$lib/server/errorQuote`
that fetches a random verse first, then throws `error(status, body)`
with `{ message, bibleQuote, lang }`, making the quote available in
every `SectionError`. Convert all page load throws (catchalls, layout
validators, calendar, prayers, recipes, fitness, cospend, admin) and
hooks.server auth gates to the helper. Add `src/error.html` as a
branded last-resort fallback.
2026-04-20 22:39:39 +02:00

6 lines
218 B
TypeScript

import type { PageServerLoad } from './$types';
import { errorWithVerse } from '$lib/server/errorQuote';
export const load: PageServerLoad = ({ fetch, url }) =>
errorWithVerse(fetch, url.pathname, 404, 'Not found');