char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: ESLint config updates (#27700)f1357e499

char/aliceai-t5-moe
2.0 KiB74 linesraw
1<script lang="ts">
2	import { goto } from '$app/navigation';
3	import { page } from '$app/stores';
4	import { ServerErrorSplash } from '$lib/components/app';
5	import { APP_NAME, ROUTES } from '$lib/constants';
6
7	let error = $derived($page.error);
8	let status = $derived($page.status);
9
10	// Check if this is an API key related error
11	let isApiKeyError = $derived(
12		status === 401 ||
13			status === 403 ||
14			error?.message?.toLowerCase().includes('access denied') ||
15			error?.message?.toLowerCase().includes('unauthorized') ||
16			error?.message?.toLowerCase().includes('invalid api key')
17	);
18
19	function handleRetry() {
20		// Navigate back to home page after successful API key validation
21		goto(ROUTES.START);
22	}
23</script>
24
25<svelte:head>
26	<title>Error {status} - {APP_NAME}</title>
27</svelte:head>
28
29{#if isApiKeyError}
30	<ServerErrorSplash
31		error={error?.message || 'Access denied - check server permissions'}
32		onRetry={handleRetry}
33		showRetry={false}
34		showTroubleshooting={false}
35	/>
36{:else}
37	<!-- Generic error page for non-API key errors -->
38	<div class="flex h-full items-center justify-center">
39		<div class="w-full max-w-md px-4 text-center">
40			<div class="mb-6">
41				<div
42					class="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10"
43				>
44					<svg
45						class="h-8 w-8 text-destructive"
46						fill="none"
47						stroke="currentColor"
48						viewBox="0 0 24 24"
49					>
50						<path
51							d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"
52							stroke-linecap="round"
53							stroke-linejoin="round"
54							stroke-width="2"
55						/>
56					</svg>
57				</div>
58
59				<h1 class="mb-2 text-2xl font-bold">Error {status}</h1>
60
61				<p class="text-muted-foreground">
62					{error?.message || 'Something went wrong'}
63				</p>
64			</div>
65
66			<button
67				class="rounded-md bg-primary px-4 py-2 text-primary-foreground hover:bg-primary/90"
68				onclick={() => goto(ROUTES.START)}
69			>
70				Go Home
71			</button>
72		</div>
73	</div>
74{/if}