diff --git a/src/main/sentry.ts b/src/main/sentry.ts index 2d5038046..22000ee6e 100644 --- a/src/main/sentry.ts +++ b/src/main/sentry.ts @@ -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 diff --git a/src/renderer/src/initialize/sentry.ts b/src/renderer/src/initialize/sentry.ts index 40b8f689d..402cd285c 100644 --- a/src/renderer/src/initialize/sentry.ts +++ b/src/renderer/src/initialize/sentry.ts @@ -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, })