aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/__error.svelte
blob: b62b158f183b783df4226a74aa8aa996123d0b5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script context="module">
	export function load({ error, status }) {
		if (error.message.includes('not found')) {
			error.message = 'Page not found.';
			status = 404;
		}

		return {
			props: {
				error,
				status
			}
		};
	}
</script>

<script>
	import { Icon, PageNotFound } from '$comp';
	export let status, error;
</script>

{#if status === 404}
	<PageNotFound />
{:else}
	<div class="flex justify-center items-center mt-20">
		<div class="space-y-5 text-center">
			<a href="/">
				<Icon icon="logo" style="mx-auto" />
			</a>

			<Icon icon="error" style="mx-auto w-56" />

			<h1 class="font-bold text-5xl">Error</h1>
			<p class="px-1 w-full md:w-96 break-all font-bold">{error.message.toUpperCase()}</p>
			<p>Please try again or contact support.</p>
		</div>
	</div>
{/if}