Urara-Blog/.svelte-kit/runtime/components/error.svelte
2022-08-14 01:14:53 +08:00

29 lines
618 B
Svelte

<script context="module">
/** @type {import('@sveltejs/kit').Load} */
export function load({ error, status }) {
return {
props: { error, status }
};
}
</script>
<script>
/** @type {number} */
export let status;
/** @type {Error & {frame?: string} & {loc?: object}} */
export let error;
</script>
<h1>{status}</h1>
<pre>{error.message}</pre>
<!-- TODO figure out what to do with frames/stacktraces in prod -->
<!-- frame is populated by Svelte in its CompileError and is a Rollup/Vite convention -->
{#if error.frame}
<pre>{error.frame}</pre>
{/if}
{#if error.stack}
<pre>{error.stack}</pre>
{/if}