/
dimamir
/
rill
Обзор
Документация
Войти
/
dimamir
/
rill
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web-admin/src/features/errors/ErrorBoundary.svelte
25 строк
783 B
Eric P Green
Cloud UI: Add page for shareable link via magic token (#5163)
03 июл 2024, 19:20
Не верифицирован
03 июл 2024, 19:20
d4aaf25
Код
Авторство
О чём код?
<script lang="ts"> /** * This file allows us to navigate to the `ErrorPage` when errors occur during runtime. * SvelteKit's `+error.svelte` file is itself an error boundary, but it only gets hit for errors during routing. */ import { afterNavigate } from "$app/navigation"; import ErrorPage from "@rilldata/web-common/components/ErrorPage.svelte"; import { errorStore, isErrorStoreEmpty } from "./error-store"; $: ({ statusCode, header, body, detail, fatal } = $errorStore); afterNavigate(() => { // Checks to see if we're on the error page (and navigating away) if (!$isErrorStoreEmpty) { errorStore.reset(); } }); </script> {#if $isErrorStoreEmpty} <slot /> {:else} <ErrorPage {statusCode} {header} {body} {detail} {fatal} /> {/if}