ad154bf914
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.
19 lines
452 B
Svelte
19 lines
452 B
Svelte
<script lang="ts">
|
|
import SectionError from '$lib/components/SectionError.svelte';
|
|
import { page } from '$app/stores';
|
|
|
|
let faithLang = $derived($page.params.faithLang);
|
|
let isEnglish = $derived(faithLang === 'faith');
|
|
let sectionLabel = $derived(
|
|
faithLang === 'fides'
|
|
? { en: 'Fides', de: 'Fides' }
|
|
: { en: 'Faith', de: 'Glaube' }
|
|
);
|
|
</script>
|
|
|
|
<SectionError
|
|
sectionHref="/{faithLang}"
|
|
{sectionLabel}
|
|
{isEnglish}
|
|
/>
|