Some checks failed
CI / Test backend (pull_request) Successful in 19s
CI / Check ui (pull_request) Successful in 40s
CI / Docker / caddy (pull_request) Failing after 43s
CI / Docker / ui (pull_request) Successful in 1m17s
CI / Docker / backend (pull_request) Successful in 1m58s
CI / Docker / runner (pull_request) Successful in 2m12s
49 lines
1.6 KiB
Svelte
49 lines
1.6 KiB
Svelte
<script lang="ts">
|
|
import * as Sentry from '@sentry/sveltekit';
|
|
import { Button } from '$lib/components/ui/button';
|
|
|
|
function throwClientError() {
|
|
throw new Error('GlitchTip client-side test error — ' + new Date().toISOString());
|
|
}
|
|
|
|
function captureManual() {
|
|
Sentry.captureException(
|
|
new Error('GlitchTip manual capture test — ' + new Date().toISOString())
|
|
);
|
|
alert('Manually captured exception sent to GlitchTip.');
|
|
}
|
|
</script>
|
|
|
|
<div class="max-w-lg mx-auto py-16 flex flex-col gap-6">
|
|
<h1 class="text-2xl font-bold text-zinc-100">GlitchTip Test Page</h1>
|
|
<p class="text-zinc-400 text-sm">
|
|
Use the buttons below to fire test errors. Check
|
|
<a
|
|
href="https://errors.libnovel.cc"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
class="text-amber-400 hover:text-amber-300 underline">errors.libnovel.cc</a
|
|
> to confirm they arrive.
|
|
</p>
|
|
|
|
<div class="flex flex-col gap-3">
|
|
<!-- Triggers an unhandled JS exception → caught by handleError in hooks.client.ts -->
|
|
<Button variant="destructive" onclick={throwClientError}>
|
|
Throw unhandled client-side error
|
|
</Button>
|
|
|
|
<!-- Sends an exception directly via Sentry.captureException -->
|
|
<Button variant="outline" onclick={captureManual}>
|
|
Manually capture exception (Sentry.captureException)
|
|
</Button>
|
|
|
|
<!-- SSR load error — visit this URL to trigger a server-side throw -->
|
|
<a
|
|
href="/glitchtip-test?server_error=1"
|
|
class="text-sm text-zinc-400 hover:text-amber-400 underline text-center"
|
|
>
|
|
Trigger server-side load error (navigate here with ?server_error=1)
|
|
</a>
|
|
</div>
|
|
</div>
|