Skip to content

Commit 9ffcfde

Browse files
committed
Test Sentry
1 parent 4690136 commit 9ffcfde

5 files changed

Lines changed: 40 additions & 31 deletions

File tree

components/modules/block/BlockOverview.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup>
22
/** Vendor */
3+
import * as Sentry from "@sentry/nuxt";
34
import { DateTime } from "luxon"
45
56
/** UI */
@@ -344,6 +345,9 @@ const handleViewRawTransactions = () => {
344345
modalsStore.open("rawData")
345346
}
346347
348+
function name123() {
349+
Sentry.captureException(new Error("Test Sentry direct capture"));
350+
}
347351
function triggerClientError() {
348352
throw new Error("Nuxt Button Error")
349353
}
@@ -361,7 +365,8 @@ function triggerClientError() {
361365
</Flex>
362366
363367
<Flex align="center" gap="8">
364-
<Button @click="router.push(`/block/${height - 1}`)" type="secondary" size="mini" :disabled="height === 0">
368+
<!-- <Button @click="router.push(`/block/${height - 1}`)" type="secondary" size="mini" :disabled="height === 0"> -->
369+
<Button @click="name123" type="secondary" size="mini" :disabled="height === 0">
365370
<Icon name="arrow-redo-right" size="16" color="secondary" :style="{ transform: 'scaleX(-1)' }" />
366371
<Text :class="$style.block_nav__txt">Prev</Text>
367372
</Button>

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default defineNuxtConfig({
7676
version: "1.20.0",
7777

7878
sentry: {
79-
dsn: process.env.SENTRY_DSN || "",
79+
dsn: process.env.SENTRY_DSN,
8080
},
8181

8282
API_MAINNET: "",

sentry.client.config.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@
2121

2222
import * as Sentry from "@sentry/nuxt";
2323

24-
export default defineNuxtPlugin(() => {
25-
const config = useRuntimeConfig();
26-
const sentryConfig = (config.public.sentry as { dsn: string });
27-
28-
Sentry.init({
29-
dsn: sentryConfig.dsn,
30-
31-
sendDefaultPii: true,
32-
33-
integrations: [
34-
Sentry.replayIntegration(),
35-
Sentry.feedbackIntegration({
36-
colorScheme: "system",
37-
}),
38-
],
39-
40-
tracesSampleRate: 1.0,
41-
replaysSessionSampleRate: 0.1,
42-
replaysOnErrorSampleRate: 1.0,
43-
enableLogs: true,
44-
});
24+
const config = useRuntimeConfig();
25+
const sentryConfig = (config.public.sentry as { dsn: string });
26+
27+
console.log("[SENTRY DSN CLIENT]", sentryConfig.dsn);
28+
29+
Sentry.init({
30+
dsn: sentryConfig.dsn,
31+
32+
sendDefaultPii: true,
33+
34+
integrations: [
35+
Sentry.replayIntegration(),
36+
Sentry.feedbackIntegration({
37+
colorScheme: "system",
38+
}),
39+
],
40+
41+
tracesSampleRate: 1.0,
42+
replaysSessionSampleRate: 0.1,
43+
replaysOnErrorSampleRate: 1.0,
44+
enableLogs: true,
4545
});

sentry.server.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
import * as Sentry from "@sentry/nuxt";
1212

13-
export default defineNuxtPlugin(() => {
14-
const config = useRuntimeConfig();
15-
const sentryConfig = config.public.sentry as { dsn: string };
13+
const config = useRuntimeConfig();
14+
const sentryConfig = config.public.sentry as { dsn: string };
1615

17-
Sentry.init({
18-
dsn: sentryConfig.dsn,
19-
tracesSampleRate: 1.0,
20-
enableLogs: true,
21-
});
16+
console.log("[SENTRY DSN SERVER]", sentryConfig.dsn);
17+
18+
Sentry.init({
19+
dsn: sentryConfig.dsn,
20+
tracesSampleRate: 1.0,
21+
enableLogs: true,
2222
});

server/api/test-sentry.get.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default defineEventHandler((event) => {
2+
const config = useRuntimeConfig(event);
3+
return { sentryDsn: config.public.sentry?.dsn || null };
4+
});

0 commit comments

Comments
 (0)