-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathindex.tsx
More file actions
41 lines (38 loc) · 872 Bytes
/
index.tsx
File metadata and controls
41 lines (38 loc) · 872 Bytes
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
39
40
41
import { createFileRoute } from '@tanstack/react-router';
import { createServerFn } from '@tanstack/react-start';
const throwServerError = createServerFn().handler(async () => {
throw new Error('Sentry Server Function Test Error');
});
export const Route = createFileRoute('/')({
component: Home,
});
function Home() {
return (
<div>
<button
type="button"
onClick={() => {
throw new Error('Sentry Client Test Error');
}}
>
Break the client
</button>
<button
type="button"
onClick={async () => {
await throwServerError();
}}
>
Break server function
</button>
<button
type="button"
onClick={async () => {
await fetch('/api/error');
}}
>
Break API route
</button>
</div>
);
}