chore: add sentry capture console to debug

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-08-18 12:49:26 +08:00
parent 779236e082
commit e374aa8d3f
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 16 additions and 3 deletions

View File

@ -4,6 +4,12 @@ import { FetchError } from "ofetch"
export const initializeSentry = () => {
Sentry.init({
dsn: process.env.VITE_SENTRY_DSN,
integrations: [
Sentry.captureConsoleIntegration({
levels: ["error"],
}),
],
beforeSend(event, hint) {
const error = hint.originalException

View File

@ -2,7 +2,12 @@ import { env } from "@env"
import { version } from "@pkg"
import { channel } from "@renderer/constants"
import { useEffect } from "react"
import { createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from "react-router-dom"
import {
createRoutesFromChildren,
matchRoutes,
useLocation,
useNavigationType,
} from "react-router-dom"
import { SentryConfig } from "../configs"
@ -25,13 +30,15 @@ export const initSentry = async () => {
createRoutesFromChildren,
matchRoutes,
}),
Sentry.captureConsoleIntegration({
levels: ["error"],
}),
posthog.sentryIntegration({
organization: "follow-rg",
projectId: 4507570439979008,
severityAllowList: ["error", "info"], // optional: here is set to handle captureMessage (info) and captureException (error)
},
),
}),
],
...SentryConfig,
})